| Author |
STrange error with error-page in web.xml
|
Caesar Dutta
Ranch Hand
Joined: Sep 18, 2004
Posts: 30
|
|
Hi, My web application structure is as follows: SendError {contains index.html, form.html} | |__WEB-INF {contains web.xml} | |_classes index.html ------------- <html><title>What is this</title> <body>This is my body</body> </html> form.html --------- <html> <body> This is an error page <body> </html> web.xml ------- <web-app> <error-page> <error-code>200</error-code> <location>/form.html</location> </error-page> </web-app> I am testing this in Sun Java Application Server, BeaWeblogic, and finally Tomcat 5.0 If I take out the portion <error-page>...</error-page> from web to xml then on http://localhost:85/SendError is giving the index .html. But if I put the block back in web.xml the output is from form.html. If anybody can help, on what is happening I will be very grateful. Thanks, Caesar
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
Originally posted by Caesar Dutta: Hi, web.xml ------- <web-app> <error-page> <error-code>200</error-code> <location>/form.html</location> </error-page> </web-app> But if I put the block back in web.xml the output is from form.html.
Caesar , First of all 200 is not an error code. Whenever a request is processed , response can be categorized as 200 is a success code, You should not put it in <error-page> tag. on every successful request server will return 2xx response and you will never be able to see any other code if 200 is place inside your <error-page> tag.
|
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
|
 |
Caesar Dutta
Ranch Hand
Joined: Sep 18, 2004
Posts: 30
|
|
Thanks Shailesh so much. I put 9000 and it worked. Thanks again.
|
 |
 |
|
|
subject: STrange error with error-page in web.xml
|
|
|