Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Overcoming an ERROR!

Thread view: 
vysh - 05 Jun 2007 08:28 GMT
hi,
       I have devoloped an application using Struts.I am passing
parameters with the url on many occations in my application.If a
person types any of these url with out the parameters,it will give a
null pointer exception.I have given an error page for all my jsp
pages.But as it is a servlet generated error,instead of redirecting to
the error page it is showing the exception.
How to overcome this problem?
Is there any special method for handling such errors,in struts?

any ideas?
thanks,
vysh
Dhananjay - 05 Jun 2007 12:10 GMT
> hi,
>         I have devoloped an application using Struts.I am passing
[quoted text clipped - 9 lines]
> thanks,
> vysh

Yes you can add a global exception in struts config like this:

<global-exceptions>
     <exception
          type="java.lang.Exception"
          key="error.input"
          path="/WEB-INF/errors/errorPage.jsp"/>
</global-exceptions>

Hope this helps.

Regards
Dhananjay


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.