dcsimg
Exception Handling in JSP Pages using errorpage
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ARVIND_DAGA
Posted On:   Wednesday, January 9, 2002 08:04 AM

Hi All, Could you please let me know what would be the best way to show user friendly message in JSP pages, like "Please enter Employee last name". I am using Jdeveloper 3.2.3. I have created a EditForm to update record into the database table. I want a user-friendly message if any mandatory column is missing (not the client site validation form javascript). I know how to use errorpage etc. I tried the following way to do that : First method: Store the User Error message in session.setAttribute and try to reterive in errorpage using session.getAttribute. But session.getAttribute is null on the errorpage. Actually when error is happening on the original jsp page its direct to error page   More>>

Hi All,


Could you please let me know what would be the best way to show user friendly message in JSP pages, like "Please enter Employee last name". I am using Jdeveloper 3.2.3. I have created a EditForm to update record into the database table. I want a user-friendly message if any mandatory column is missing (not the client site validation form javascript).



I know how to use errorpage etc. I tried the following way to do that :



First method: Store the User Error message in session.setAttribute and try to reterive in errorpage using session.getAttribute. But session.getAttribute is null on the errorpage. Actually when error is happening on the original jsp page its direct to error page without looking into the original page



Second method : Throw the exception in the original page for ex : <% if (request.getParameter("LastName") == null) { throw new Exception("Please enter last name"); } %>;

Even in this case its directly going to error page without looking into the original page. Since exception.getMessage() is giving the exception name etc only.



what could be the better way to do it. Do I need to do the client side validation using Java Script for these cases, and let it go to error page for server side validation and print the exception.getMessage() and printStacktrace() etc.


Please reply ASAP. Arvind    <<Less

Re: Exception Handling in JSP Pages using errorpage

Posted By:   Anonymous  
Posted On:   Wednesday, January 9, 2002 09:31 AM

Please DO NOT post the same question, twice.

http://www.jguru.com/forums/view.jsp?EID=714595


Regards

About | Sitemap | Contact