• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

STrange error with error-page in web.xml

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Caesar Dutta
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Shailesh so much. I put 9000 and it worked.

Thanks again.
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic