File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes handle 404 error Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "handle 404 error" Watch "handle 404 error" New topic
Author

handle 404 error

jim li
Ranch Hand

Joined: May 20, 2008
Posts: 176

i have configured the following code to catch 404 error, and i have context root "/"

<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>

when i type in some page does not exist like this http://localhost:8080/error.jasfeee, i got the error page

however , if i type in http://localhost:8080/error.jasfeee/asfe, i got the error page, but the page style was totally messed up. can anyone give me some suggestion?
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

If the styles are messed up, the most likely culprit is the stylesheets, no?

Are you using valid URLs to reference the style sheets? Or just relying on page-relative URLs?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
IntelliJ Java IDE
 
subject: handle 404 error
 
Threads others viewed
Displaying custom error page
Catching HTTP Error Responses
Calculator example
response.sendError & error-page
User Defined Error Page for 404
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture