views:

215

answers:

1

Is it possible to set the http response header with a status of 404 instead of 200 when using struts forwards?

We have a generic error page that goes out with a status of 200OK. We want to update the header to show a 404 instead. Is that possible?

A: 

Yes. Use the HttpServletResponse.setStatus(int) method on your while you render the page (action or JSP).

Wolfgang