Using web.xml to map all requests ending in .do to a particular servlet
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Byford
Posted On:   Tuesday, July 30, 2002 11:53 AM

Hi, I am running tomcat 3.x. I have created a servlet which authenticates users and reroutes users. I wish to direct all requests ending in .do to this servlet. Ive named and maped the servlet in web.xml and placed this file in the web-inf directory at /webapps/myproject/web-inf. Here is the web.xml excerpt &ltservlet&gt &ltservlet-name&gt director &lt/servlet-name&gt &ltservlet-class&gt myproject.centralServlet &lt/servletclass&gt &lt/servlet&gt &ltservlet-mapping&gt &ltservlet-name&gt director &lt/servlet-name&gt &lturl-pattern&gt   More>>

Hi,


I am running tomcat 3.x. I have created a servlet which authenticates users and reroutes users. I wish to direct all requests ending in .do to this servlet.


Ive named and maped the servlet in web.xml and placed this file in the web-inf directory at /webapps/myproject/web-inf.
Here is the web.xml excerpt


&ltservlet&gt

&ltservlet-name&gt director &lt/servlet-name&gt

&ltservlet-class&gt myproject.centralServlet &lt/servletclass&gt

&lt/servlet&gt


&ltservlet-mapping&gt

&ltservlet-name&gt director &lt/servlet-name&gt

&lturl-pattern&gt /*.do &lt/url-pattern&gt

&lt/servlet-mapping&gt


Other mappings work to direct the servlet, for example if i use /testdirector as a url-pattern and use. localhost:8080/myproject/testdirector as the url it works?

   <<Less

Re: Using web.xml to map all requests ending in .do to a particular servlet

Posted By:   Laurent_Mihalkovic  
Posted On:   Wednesday, July 31, 2002 12:56 AM

Not sure what you are describing as your problem... however here is a section from my own mapping description. you will notice that the difference is that you have a forward slash in front of the pattern. The following works just fine for me.


action
*.do



cheers,
About | Sitemap | Contact