开发者

how to specify param-value in init-param for a servlet using url-pattern?

开发者 https://www.devze.com 2023-03-25 03:03 出处:网络
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:

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号