• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Jsp error page handling

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I got a full of list items in my List.jsp, at the end and an exception happening, I am using error.jsp for error handling, the problem is the error.jsp is included in the list page with all details, but not displaying, it displays the actual list page. anybody knows any workaround for this problem.
Thanks
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing can be said for sure without looking at your code and the deployment descriptor(web.xml).
Till then, do you have the isErrorPage and the errorPage attributes set?
 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

for testing I put this snippet at the end of my list page

if more information needed ,please let me know.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then your error page should be called.
What output are you getting now? Do you get an exception?
What about the error page configuration in your web.xml.
Please let us know.
 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

this is in the Web.xml
My error.jsp is got called, it is included in the response, but not displaying, I would like to display the errorpage instead of list page, if an eror happens. I can paste the whole html here, if necessary.
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My error.jsp is got called, it is included in the response, but not displaying,


I am not getting this. How do you know that it is called or invoked but the output is not displayed?
Have you checked the server log?
 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
When you look the viewsource you can see the error.jsp is dumped at the end of the page, since all the list content is dumped, the error.jsp is not displayed on the screen, what I want is if an error happens, how can I get only error page, not the content form list page, becasue the list page is not complete.
Thanks.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How much Java do you have in your JSPs?
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

When you look the viewsource you can see the error.jsp is dumped at the end of the page


The error.jsp is not included in the list.jsp.
The buffer is cleared and the control is transferred to error.jsp.
The only thing you should see is error.jsp
And one more thing, in your web.xml either use the error-code or exception-type but not both.
Also since the list.jsp defines the error page(not good programming, but OK for testing purpose), it is not required to be present in the web.xml.
Consider modifying your web.xml.

Hope this helps
 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my main jsp is using tiles to insert the other jsps,at the end it is using Tags to ouput the html. Is is not having much java coded in it, but it got Tags, everything is done by tags.I hope that is what usually do.
 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I removed all errorcode from web.xml, now it has only

I removed the
from my list page
No what i get is
this error displayed on the web page.
 
This one time, at bandcamp, I had relations with a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic