Maybe you should rethink your design wether the EXTRA_WORD should rather be a request parameter than a part of the URI.
SCEA5, Certified ScrumMaster
Joined: Oct 08, 2006
Just implement the filter on the generic url pattern and let it read the same configuration file how to forward the 'pretty URL' to a 'real url'. If there is no such mapping then just let it continue the request transparently.
Joined: Dec 20, 2008
Originally posted by Bauke Scholtz: Just implement the filter on the generic url pattern and let it read the same configuration file how to forward the 'pretty URL' to a 'real url'. If there is no such mapping then just let it continue the request transparently.
The thing is that..The application is already been created and it's up and it works fine without that EXTRA_WORD thing. i.e all JSPs and JS file contains all form Actions, hrefs, and ajax call in the form of ActionServlet?My_Action=Somthing.. So if I now want to insert this EXTRA_WORD, i'll have to change all these JSPs and JS files.
Let me put the problem in more simpler way. we have an application .. it's hosted on ..say.. www.application.com their users are say CUST1 and CUST2 and many more... Previously, the customer were given the generic URL that is..www.application.com
now we want to give them more personalized URL like www.application.com/CUST1 Also we'll show some CSS effects on the bases the customer specific URL(like their logo or something like that)
sohil: will be given an extra word at runtime..e.g EXTRA_WORD
You know that whatever action you are sending in request ,the web container will try to match it in web.xml to find a suitable match. The point is, you should understand that web container is basically trying to do pattern matching.you have specified the Url-pattern for your servlet in the web.xml .
BUT you are trying to do the exact match. There are three ways to give url pattern in the web.xml 1.Exact match 2.Directory match 3.Extension match
you should go with Directory match rather than exact match as your request action will change partially at runtime. [ December 23, 2008: Message edited by: raj malhotra ]