以编程方式添加上下文参数?
有没有办法以编程方式添加上下文参数?我不想添加 web-xml。具体来说,我想做这篇文章中的答案所建议的事情: 在 JSF 1.2 中通过 EL 调用带参数的方法。
Is there a way to add a context-param programmatically? I don't want to add in the web-xml. Specifically I want to do what the answer in this post suggests: Invoking methods with parameters by EL in JSF 1.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的。
在 servlet 的 init 方法中,
简单地使用 OR
这一定可以满足您的要求。
对于应用程序加载,
在 web.xml 中,当您声明此 servlet 时,请为此 servlet 提供
元素作为 1。Yes it is possible.
In the servlet's init method, use
OR simply
This must do the trick for you.
For the application load,
In web.xml, when you declare this servlet, provide
<load-on-startpup>
element as 1 for this servlet.