its my controller
Code:
@Controller
@RequestMapping("/login")
public class MyAddressHndler {
@RequestMapping("success")
public ModelAndView successLogin(HttpServletRequest httpServletRequest) {
return new ModelAndView("home").addObject("usernameName", SecurityContextHolder.getContext().getAuthentication().getName());
}
@RequestMapping("failure")
public String failureLogin() {
return "accessDeniedPage";
}
}
and its my servletDispatcher
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="controller"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
dear skram wheras i test my URLs that be mentioned under WEB-INF/pages/accessDeniedPage.jsp or WEB-INF/pages/home.jsp in my applicationContext-security.xml like as below:
Code:
<intercept-url pattern="/WEB-INF/pages/accessDeniedPage.jsp" access="isAnonymous()"/>
was wrong and this style that i write in the applicationContext-security.xml is correct, i think its not make any problem.because i can be login according to decition in MyProviderManager now.
only problem is here when i loggined in to system and authenticating in MyProviderManager if open another tab and send a request to server for login page its failed and i get 404 error. but until i dont login i can get my login page in any number tab of browser
i use than sessionRegistry and securityContextHolder in MyProviderManager in //my coed is here
Code:
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
//my coed is here
}
method.
do you know how to cause that when clicking on back or forward button in my browser it make a request from client to server?
for example when i logined to system and press back button of browser to loginPage authenticationEntryPoint be called.
so thanks.