开发者

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!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜