Hello, I'm quite new to spring security and I'm trying some basic things. I have this login form, and if login is successful, I would like it to redirect to a success page, and I cannot figure out how. Before spring security, the action in the form tag was directed at the controller which directed to a success page after login. But with spring security, the form action is now directed at /j_spring_security_check and after a successful login, it redirects to "/". Can someone please advise on this?
Thanks a lot
Here's my code
Code:<code> <?xml version="1.0" encoding="UTF-8"?> <http auto-config="true"> <intercept-url pattern="/login.ccin" access="IS_AUTHENTICATED_ANONYMOUSLY" /> <intercept-url pattern="/secure/extreme/**" access="ROLE_ADMIN" /> <intercept-url pattern="/secure/**" access="ROLE_USER" /> <intercept-url pattern="/**" access="ROLE_ADMIN" /> <form-login login-page="/login.ccin" /> <form-login login-page="/login.ccin" authentication-failure-url="/login.ccin?login_error=1" /> </http> <authentication-provider> <user-service> <user name="temp" password="temp" authorities="ROLE_ADMIN" /> <user name="hi" password="bye" authorities="ROLE_ADMIN" /> </user-service> </authentication-provider> <authentication-manager alias="authenticationManager" /> <beansbean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter"> <beansproperty name="authenticationEntryPoint" ref="authenticationProcessingFilterEntryPoint" /> <beansproperty name="accessDeniedHandler"> <beansbean class="org.springframework.security.ui.AccessDeniedHandlerImpl"> <beansproperty name="errorPage" value="/accessdenied.ccin" /> </beansbean> </beansproperty> </beansbean> <beansbean id="authenticationProcessingFilterEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint"> <beansproperty name="loginFormUrl" value="/login.ccin" /> <beansproperty name="forceHttps" value="false" /> </beansbean> <beansbean id="authenticationProcessingFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter"> <beansproperty name="authenticationManager" ref="authenticationManager"></beansproperty> <beansproperty name="authenticationFailureUrl" value="/login.ccin?login_error=1" /> <beansproperty name="defaultTargetUrl" value="/" /> <beansproperty name="filterProcessesUrl" value="/j_spring_security_check" /> </beansbean> <beansbean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy"> <filter-chain-map path-type="ant"> <filter-chain pattern="/**" filters="httpSessionContextIntegrationFilter,authenticationProcessingFilter,exceptionTranslationFilter" /> </filter-chain-map> </beansbean> </beansbeans> </code> <code> <form id="login" action="<c:url value='j_spring_security_check'/>" method="post"> <table> <tr> <td><span class="red"> <form:errors path="*" /> </span></td> </tr> <tr> <td colspan="3"> <h4>Sign In</h4> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="300"> <tr> <td width="50%"><span class="heading"> E-mail </span></td> <td width="50%"><input type="text" name="j_username" /></td> </tr> <tr> <td width="50%"><span class="heading">Password</span></td> <td width="50%"><input type="password" name="j_password" /></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="300"> <tr> <td align="right"> <div id="reg"> <div align="right"><input type="submit" value="Sign In" /> </div> </div> </td> </tr> </table> </center> </form> </code>



