File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Jsp error page handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Jsp error page handling" Watch "Jsp error page handling" New topic
Author

Jsp error page handling

philip johnson
Ranch Hand

Joined: Dec 25, 2007
Posts: 40
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


Philip
SCJP2, SCBCD1.3
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2712
    
    5

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?


SCJP, SCWCD.
|Asking Good Questions|
philip johnson
Ranch Hand

Joined: Dec 25, 2007
Posts: 40

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

if more information needed ,please let me know.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2712
    
    5

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

Joined: Dec 25, 2007
Posts: 40

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

Joined: Jun 06, 2007
Posts: 2712
    
    5

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

Joined: Dec 25, 2007
Posts: 40
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

How much Java do you have in your JSPs?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2712
    
    5

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

Joined: Dec 25, 2007
Posts: 40
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

Joined: Dec 25, 2007
Posts: 40
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp error page handling
 
Similar Threads
Exception handling question
Invalid Path error
strange error-page problem?
JSP and custom Exception class
response.sendError & error-page