login worj
This commit is contained in:
parent
2dbcc24761
commit
2f9a99654e
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue