how to redirect the user to login page spring mvc? -
i new spring mvc. have web application redirect user login page when clicks button in html page, when logs in, send him link had clicked.i added class called myaccessdeniedhandler configuration package didn't know .
yes kenny tai huynh tried 1 :
@component("myaccessdeniedhandler") public class myaccessdeniedhandler implements accessdeniedhandler { //@qualifier("myrequestcache") //private requestcache myrequestcache; public myaccessdeniedhandler() { } @override public void handle(httpservletrequest arg0, httpservletresponse arg1, org.springframework.security.access.accessdeniedexception arg2) throws ioexception, servletexception { // todo auto-generated method stub if (!arg1.iscommitted()) { arg0.getrequestdispatcher("/signin").forward(arg0, arg1); } } }
Comments
Post a Comment