2

I am reformatting my site due to constant side-effects of illness. I can not afford the time it takes to do hand written-tutorials and thus am replacing everything with video format only. All my content is on a Tomcat server. I have a lot of linkage to my site and wish to keep this traffick. The current measure I have taken is with a filter that sends a 301 redirect. Am I violating any standardss by just specifying a redirect in web.xml to my home page based on error codes? e.g:

...
<welcome-file-list>
        <welcome-file>Buhaugane-hyttefelt-hyttetomter-til-salgs-Filefjell-Mellom-Vestlandet-og-Aust-oslo-bergen.xhtml</welcome-file>
    </welcome-file-list>
    <error-page>
        <error-code>404</error-code>
        <location>/Buhaugane-hyttefelt-hyttetomter-til-salgs-Filefjell-Mellom-Vestlandet-og-Aust-oslo-bergen.xhtml</location>
    </error-page>
    <error-page>
        <error-code>505</error-code>
        <location>/Buhaugane-hyttefelt-hyttetomter-til-salgs-Filefjell-Mellom-Vestlandet-og-Aust-oslo-bergen.xhtml</location>
    </error-page>

...
thejartender
  • 9,339
  • 6
  • 34
  • 51
  • 1
    No problem, you are free to choose your own error page(s). 505 is an unusual error though :-) – Anders R. Bystrup Jan 10 '13 at 09:07
  • you might run into an endless loop tough if loading the xhtml page results in a 404 or a 505. This will probably totaly take down your server. – G-Man Jan 10 '13 at 09:20

1 Answers1

1

There is no problem at all with doing this. See the document below (I know it is web-logic but it applies to all java webapp's)

http://docs.oracle.com/cd/E13222_01/wls/docs81/webapp/web_xml.html#1017571

Just be sure that your error pages cannot generate an error by themselves.

tom
  • 2,735
  • 21
  • 35