You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Bailey <ch...@codeintensity.com> on 2002/06/13 00:52:41 UTC
How can I map all requests to a single servlet?
I have a web application that uses a single servlet to respond to all
requests. This is the only web app that will be running under Tomcat. How
can I set up the servlet-mapping so that it gets all requests, without doing
something like setting the <url-pattern> to be "index.*"? Or, more
specifically, I don't want the "index.page" (or whatever) being added into
the URL. So, the URL's should just be something like
"http://www.foo.com/?param=blah".
____
Chris Bailey mailto:chris@codeintensity.com
Code Intensity http://www.codeintensity.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: How can I map all requests to a single servlet?
Posted by Steve Ahlstrom <sa...@americanisp.net>.
I'd use a front controller pattern. All your requests would have an action
at the end
(ex, http://www.site.com/controllerServlet/do-something,
http://www.site.com/controllerServlet/do-something-else, etc.)
Your servlet then routes you to a requestprocessor class which strips off
the
action then maps it to a class or event handler. See Core Java Patterns.
-----Original Message-----
From: Chris Bailey [mailto:chris@codeintensity.com]
Sent: Wednesday, June 12, 2002 4:53 PM
To: Tomcat Mailing List
Subject: How can I map all requests to a single servlet?
I have a web application that uses a single servlet to respond to all
requests. This is the only web app that will be running under Tomcat. How
can I set up the servlet-mapping so that it gets all requests, without doing
something like setting the <url-pattern> to be "index.*"? Or, more
specifically, I don't want the "index.page" (or whatever) being added into
the URL. So, the URL's should just be something like
"http://www.foo.com/?param=blah".
____
Chris Bailey mailto:chris@codeintensity.com
Code Intensity http://www.codeintensity.com
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>