Manage 404 pages with a servlet

M

Mike Baroukh

Hi.

I thought about the following but don't see how to do.

Suppose I have some static content in database and I wan't to have
them
served by apache. For this, it would be nice to :
- An url like /static/image.gif is called
- Apache do not found it, so he call error document. It could be a
servlet.
- This servlet see if it is something it can generate. If no, it
returns
a true 404. Else, it generate it and forward the request to the
generated content.
- Subsequent calls to the content will return the content directly
because it exists ...

My problem is that the 404 servlet knows nothing about the initial uri
of the object that was requested. At least, I can't see where this
information is.

Does anybody have any idea ?

Thanks in advance.
 
M

Mike Baroukh

Sorry, I said something wrong : It doesn't work for ErrorDocument
handled by apache :

EroroDocument 404 /servlets/notfound

notfound servlet will not have the attribute positionned.

Finally, I think it's impossible ...

Thanks again anyway ...

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top