Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jsp error page handling

 
philip johnson
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much Java do you have in your JSPs?
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic