Hi ,
I am trying configure an error page in my
struts webapplication.
I have configured the errorpage tag in my web.xml.
In my Action class i need to redirect to the error page only when some specific values are retrned from DB.
So i tried throwing an exception as shown below:
if (code!=0&&msg!=4){
throw new Exception();
}
The above part of the code is in execute () of the Action class which has throws Exception declaration already.
Now the problem is when i am throwing the exception i am able to seeit in the logs but it is not getting redirected to errorpage.
When I remove the "throw new Excetion()" code and try to generate some exception like below:
String s=null;
if(code!=0 &&msg!=4)
{
s.toUpperCase();
}
In the above case it is working fine and i am able to redirect it to the error page.
Please let me know why the throw new Exception part is not working.
THanks in Advance