I need to know if any way is there to call spring controller from web.xml from following location:
<error-page>
<exception-type>org.demo.exceptions.InvalidSessionException</exception-type>
<location>/login.jsp</location>
</error-page>
I have created a custom exception class named as InvaliSessionException,
typically we call some jsp page from <location> tag, but what I need to do is to call login controller such as auth/login i.e. <location>/auth/login</location>.
is there any way to achieve this ?
InvaliSessionException.java
public class InvalidSessionException extends NullPointerException
{
private static final long serialVersionUID = 1L;
public String getMessage()
{
return "No user logged in.";
}
public int getExceptionType()
{
return -1;
}
}
<meta http-equiv="REFRESH" content="0;url=${applicationScope.contextPath}/auth/login"></HEAD>