@Controller
@RequestMapping(value = "/Login/**")
public class LoginController extends CommonController {
public static final String loginError = "/Login/LoginError";
@RequestMapping(value="/Login.html")
public String login() {
return Globals.login;
}
@RequestMapping(value="/LoginError.html")
public String loginError() {
return loginError;
}
}
Tiles Definition For "/accessDenied"
<definition name="/accessDenied" extends="base">
<put-attribute name="subtitle" value="Login Error" />
<put-attribute name="menu" value="/WEB-INF/tiles/templates/loginMenu.jsp" />
<put-attribute name="body" value="/WEB-INF/jsp/accessDenied/showAccessDenied.jsp" />
</definition>
showAccessDenied.jsp
<p>
Access to the specified resource has been denied.
<br />
Click <a href="<c:url value=''/>"><b><u>here</u></b></a> to try again.
</p>
<!--
For reasons why we set response status=200 refer below link
http://www.coderanch.com/t/365499/Servlets/java/web-xml-error-page-not
-->
Hope this explanation helps.
Thursday, 21 July 2011
Handling Forbidden Pages in SpringMVC3.0 using annotations
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment