[EMAIL PROTECTED] wrote:
See Thread at: http://www.techienuggets.com/Detail?tx=12338 Posted on behalf of 
a User

I have a J2EE application residing on Tomcat. The pages are dynamically 
generated. If a use enters an invalid request I redirect him to a generic error 
page (which isn't really an error page but just a jsp that display a message 
and allows a redirect back to the site's main page). I would like to return a 
status of 404 from this page but because the page gets served properly I am 
returning a status of 200. The problem with this is that my error page than 
gets indexed by search engines. Any advise on how to tackle this?

Servlet docs suggest you can nominate your JSP as an
error page for status 404 - in Tomcat you could put
this in conf/web.xml (after <welcome-file-list>)

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

then if you call response.sendError(404, "") when your
app decides the request isn't sensible, this page will
be used.  I haven't tried this.

Paul Singleton


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to