Register / Login
Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of
Clojure in Action
this week in the
Runtime URL mapping
posted 11 years ago
I like to know whether I can add
URL mapping at runtime.
For e.g. Based on some environment variables I like to set the URL mapping to be different
For e.g If the environment is dev then I have mapping for a servlet like
<servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>/dev</url-pattern> </servlet-mapping>
For qa I will have /context/qa .
<servlet-mapping> <servlet-name>MyServlet</servlet-name> <url-pattern>/qa</url-pattern> </servlet-mapping>
I don't want to set this in
web.xml as I like to have the same web.xml in all environments
I agree. Here's the link:
about web.xml file.
question on servlet-mapping
Servlet to open a pdf
how to connect Jsp to servlet to process parameters