I have made a Customised error page and want to dispaly that when an error occurs. The entry of the same has been done in web.xml(Jboss3.2.5). Although it prints the System.out.println statement on Console, written on that error page but does not make the HTML page to show on Broser. Thanks for all the help
Hi Ben, i too am using the ErrorPage in my web application and am able to display the errors using the JSP implicit object 'exception'. when ever an error is displayed, i am catching the strmsg = exception.getMessage() and prints the same on the browser.
But iam not able to handle the 'session Timeout ' using this exception object.
when the session is timedout ,the browser displays 'null' . how to trap session time out using 'exception' object.
You've highjacked anumishra1's thread. Ask your question in a new thread and I or someone else will gladly help you. (BTW: a session timing out is not an exception)
Rajendar Goud
Ranch Hand
Joined: Mar 06, 2002
Posts: 220
posted
0
sorry Ben!
Anurag Mishra
Ranch Hand
Joined: Sep 27, 2001
Posts: 133
posted
0
I have tried to use both ways, with and without isErrorPage=true but none of them seem to work. I do not even require the JSP object, just want to print a simple message. That is it.
Rajendar Goud
Ranch Hand
Joined: Mar 06, 2002
Posts: 220
posted
0
anu, you said u had tried with 'isErrorPage=true' ,but did you placed the statement in the jsp page from which the error had to be invoked.that page should have the entry like <%@page errorPage="your error jsp page" %>
it should work .
Anurag Mishra
Ranch Hand
Joined: Sep 27, 2001
Posts: 133
posted
0
<%@ page isErrorPage="true"%>. I have written this,
Rajendar Goud
Ranch Hand
Joined: Mar 06, 2002
Posts: 220
posted
0
nope anu, that shouldnt be 'true' but the jsp page name in which you had declared <%@page isErrorPage="true" %>
isErrorPage="true" means that the page is going to act as a Custom Error page.
And the jsp page which is going to throw the error should contain the declaration
<%@page errorPage="x.jsp" %>
x.jsp should have the declaration <%@page isErrorPage="true" %>
Welcome to the JavaRanch! Please adjust your displayed name to meet the JavaRanch Naming Policy. User names cannot be obviously fake and must constist of a first name and a last name.
By any chance, are you using IE as your web browser? IE generates it's own error pages for some response types rather than using the error page from the server. You can turn this off by choosing something like Tools->Internet Options->Advanced Tab->Show Friendly HTTP Error Messages and un-checking the check box.
Another option I have heard of is to change the HTTP Error status code to 200 - OK (response.setStatus(200)) in your error page. It stinks that you have to break standard defined HTTP codes to make things work with IE
Anurag Mishra
Ranch Hand
Joined: Sep 27, 2001
Posts: 133
posted
0
Thanks very much, Nathan!!! I sure worked!! I am really thankful to YOU!! Thanks very much! Good Day!
The request to change your display name was not merely a suggestion; it is a requirement for participation in the JavaRanch. Please change your display name accordingly prior to your next post.
Be aware that accounts with invalid display names are subject to closure.
"anumishra1", You have changed your display name from a valid one to an invalid one. You have 134 posts and your account will be deleted if you don't change it back immediately.
thanks, Dave
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.