- I want two login pages in my spring project
- <security:http auto-config="true">
- <security:intercept-url pattern="/corporaterepresentative/*" access="ROLE_USER" />
- <security:form-login login-page="/corporaterepresentativelogin" default-target-url="/corporaterepresentative/representativesignup"
- authentication-failure-url="/corporaterepresentativelogin" />
- <security:logout logout-success-url="/login" />
- <security:anonymous enabled="true"/>
- <security:intercept-url pattern="/corporateuser/*" access="ROLE_USER" />
- <security:form-login login-page="/corporateuserlogin" default-target-url="/corporateuser/usersignup"
- authentication-failure-url="/corporateuserlogin" />
- <security:logout logout-success-url="/login" />
- </security:http>
- <security:authentication-manager>
- <security:authentication-provider>
- <security:jdbc-user-service data-source-ref="dataSrc"
- users-by-username-query="select username,password,enabled from spring_users where username=?"
- authorities-by-username-query="select u.username, ur.authority from spring_users u, spring_roles ur where u.user_id=ur.user_id and u.username=?"/>
- </security:authentication-provider>
- </security:authentication-manager>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <form name='f' action="<c:url value='j_spring_security_check' />"
- method='POST'>
- <h2>Representative Login</h2>
- <br>
- <table align="center" border="1">
- <tr>
- <td>UserName:</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 colspan='2' align="right">
- <input name="submit" type="submit" value="submit" />
- <input name="reset" type="reset" />
- </td>
- </tr>
- <tr>
- <td> If Ur a New User <a href="corporaterepresentative/representativesignup"> Click here </a>to Register
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- <form name='f' action="<c:url value='j_spring_security_check' />"
- method='POST'>
- <h2>User Login</h2>
- <br>
- <table align="center" border="1">
- <tr>
- <td>UserName:</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 colspan='2'>
- <input name="submit" type="submit" value="submit" />
- <input name="reset" type="reset" />
- </td>
- </tr>
- <tr>
- <td> If Ur a New User <a href="corporateusersignup"> Click here </a>to Register
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>