I appreciate all the help... yes it would not be a big deal if somebody entered an address ending with .jsp and got a 404.. I am asking mostly for academic interest... I never had to get down and dirty with URIs before and clearly I never understood mapping requests to servlets...
It seems there must be a way to include JSPs without leaving a chance for a 404 error ever coming up. Yet that is percisely what would happen if the *.jsp mapping is used and the JSP is not there. Am I missing something? Thank You.
hmmmm more questions. I returned everything to original state and set my servlet to match "/test/*" URI pattern. My servlet outputs "HI," gets request dispatcher from and includes /jsp/default.jsp. There is a valid JSP page in /jsp/default.jsp.
As for the servlet mapping issue, I was thinking of using an extension filter instead, a'la Struts. I am currently looking at ways to employ URL rewriting to do this. If you have any comments - please share. Here is what I want to do:
1) Set up MyServlet for "*.ag" URLS
2) Intercept all incoming URLs.
3) Leave URL alone if it has an extension
4) Attach ".ag" to URL if it does not have an extension.
Result - all images and JSPs work, but all other URLs are forwarded to my servlet. Hopefully this will work.. I have not worked with URL rewriting yet, but I'm sure there is info out there. Thanks!
I wrote a nice long response to it, pressed the button, got error message, went back and poof! it's gone No biggie. I did not do the double-post on purpose. I understand that asking the same question twice does not increase chances of response As for the cross-post... i thought that Subject was not good. If I had the ability to delete that thread or edit the Subject... In either case, sorry about that.
We are building a bridge to serve content from CMS. Client wants to use URLs to identify content withing CMS.
Means we should get content from CMS located in alex/foo/bar. This means all requests should go to 1 servlet that does this. I tried using "/*" mapping but it screwes everything up (evn including JSPs results in recursive call because it overrides "*.jsp").
I was thinking of using extension mappings a'la Struts .do, but they want to do "http://localhost/alex/foo/bar," not "http://localhost/alex/foo/bar.SOMETHING"
So I was thinking to intercept all incoming URLs and add ".SOMETHING" to it unless it has a 3 letter extension (to keep JSPs and images working). Seems like this is the only way to keep ability to include JSPs while forwarding all other requests to CentralServlet. I am probably overthinking this, so any comments are appreciated. Thank You!