login worj

This commit is contained in:
eugenp 2013-05-01 16:13:33 +03:00
parent 2dbcc24761
commit 2f9a99654e
6 changed files with 25 additions and 8 deletions

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="spring-mvc"> <wb-module deploy-name="spring-security-login">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="spring-mvc"/> <property name="context-root" value="spring-security-login"/>
<property name="java-output-path" value="/spring-mvc/target/classes"/> <property name="java-output-path" value="/spring-security-login/target/classes"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

View File

@ -120,7 +120,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>spring-mvc</finalName> <finalName>spring-security-login</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

View File

@ -24,7 +24,7 @@ public class ClientWebConfig extends WebMvcConfigurerAdapter {
super.addViewControllers(registry); super.addViewControllers(registry);
registry.addViewController("/login.html"); registry.addViewController("/login.html");
registry.addViewController("/sample.html"); registry.addViewController("/homepage.html");
} }
@Bean @Bean

View File

@ -9,11 +9,9 @@
<intercept-url pattern="/login*" access="isAnonymous()" /> <intercept-url pattern="/login*" access="isAnonymous()" />
<intercept-url pattern="/**" access="isAuthenticated()" /> <intercept-url pattern="/**" access="isAuthenticated()" />
<form-login login-page='/login.html' default-target-url="/" <form-login login-page='/login.html' default-target-url="/homepage.html"
authentication-failure-url="/login.html?error=true" /> authentication-failure-url="/login.html?error=true" />
<logout logout-success-url="/login.html" />
</http> </http>
<authentication-manager> <authentication-manager>

View File

@ -3,5 +3,24 @@
<body> <body>
<h1>Login</h1> <h1>Login</h1>
<form name='f' action="<c:url value='j_spring_security_check' />" method='POST'>
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' value=''></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="submit" /></td>
</tr>
</table>
</form>
</body> </body>
</html> </html>