The Artima Developer Community
Sponsored Link

Java Answers Forum
Any way to supress default error page?

3 replies on 1 page. Most recent reply: Dec 15, 2003 4:20 PM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Dave

Posts: 2
Nickname: shakin
Registered: Dec, 2003

Any way to supress default error page? Posted: Dec 15, 2003 1:36 PM
Reply to this message Reply
Advertisement
I've been thrown into maintaining a Java web app even though I have no Java experience and right now my biggest problem is not being able to properly test on a dev server, so I am putting up some test pages on the live server, but there is a default error page that prevents me from seeing what is causing the error.

Is there any way in JSP to prevent the default error page from appearing on a per-page basis? I'd like to see he error message on one page without affecting the whole site. It's a Websphere 5 on Linux server.

Thanks.


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Any way to supress default error page? Posted: Dec 15, 2003 1:52 PM
Reply to this message Reply
For a JSP page you can have your own error page. You can define your own JSP page using page directive in your main JSP page as:

<%@ page errorPage="mycustomerrorpage.jsp" isErrorPage="true" %>

Now you can customize your error message or debug message on mycustomerrorpage.jsp page.

Dave

Posts: 2
Nickname: shakin
Registered: Dec, 2003

Re: Any way to supress default error page? Posted: Dec 15, 2003 1:55 PM
Reply to this message Reply
Thanks. Now, how would I make mycustomerrorpage.jsp display the compilation error? I know my local Tomcat install does this by default, which makes it easy to go directly to the problem.

Thanks again.

Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Any way to supress default error page? Posted: Dec 15, 2003 4:20 PM
Reply to this message Reply
page directive is used to have a custom error page at runtime. If your page is not compiled when you call your JSP first time, then you may want to compile your JSP to check compilation errors when you are done with your coding, before you deploy your JSP page for use. Tomcat allows you to do that. Please refer to Tomcat documentation for pre-compiling JSP. Refer to jspc tool included with Tomcat or using ant to precompile JSp pages.

Flat View: This topic has 3 replies on 1 page
Topic: java input/output file handling Previous Topic   Next Topic Topic: about JFrame.setVisible

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use