how to specify param-value in init-param for a servlet using url-pattern?
I want my web.xml to be able to specify param-value for a init-param for a servlet using the url used at runtime. For example:
<servlet>
<servlet-name>startup</servlet-name>
<servlet-class>com.abc.xyz.WebServlet</servlet-class>
<init-param>
<param-name>productCode</param-name>
<param-value>prod1</param-value>
</init-param>
</servlet>
Now, i want the param-value to be set based on the url the user types(prod2 or prod3). Something similar to how we can specify servlet mapping based on url-pattern. I开发者_StackOverflow中文版s there a way?
Note: I'm using Weblogic. If there is a way to implement this functionality from Weblogic, that's also fine.
Thanks!
精彩评论