Hello everyone, what's the most J2EE-conformant way to have other file name endings than .jsp treated as java server page by the servlet container? I'd prefer if the used technology (JSP, ASP, ...) is kept hidden from the user (he just sees .html). Regards, Andreas
It would be ill-advised to map the JSP's to some extension that is known to be 'static' (such as .html). Trust the voice of experience! We did this at one of my former jobs and it caused no end of problems. Turns out there are 'helpful' servers out there (AOL servers included) that will cache html pages. It resulted in clients being sent pages full of data from other clients due to this 'helpful' caching. Proceed with caution. bear
Just to add to Bill's answer, you can also do with this on a JSP by JSP basis by using the servlet-mapping elements in your web.xml file. Alternatively, and something that I've done recently, you can use a filter to transform incoming requests to xyz.html to a specific JSP. If you take a look at my website and click on one of the links in the calendar at the top-right, you'll notice that all these links all reference HTML pages. All of these pages are in fact dynamically generated, and the filter intercepts the requests for xyz.html and redirects them to servlets and JSPs. Again, just another solution, depending on what you want to do.
I don't know all the details of the problem we were having since it was being caused off-site somewhere between our servers and the client systems. Nothing we changed re caching control seemed to help. We finally changed the 'faked' file extension from .html to .page and all was well. Very wierd, and lotsa hair (that I don't have in the first place) was lost over that one! bear