如何在 Struts2 中使用 Servlet [英] How to use Servlet in Struts2
本文介绍了如何在 Struts2 中使用 Servlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将 servlets
与 Struts2
一起使用?
How to use servlets
together with Struts2
?
推荐答案
我假设您想知道在将所有内容映射到 Struts2 过滤器后如何将 servlet 与 Struts2 结合使用.
I assume you want to know how to use a servlet in conjunction with Struts2 when you have mapped everything to the Struts2 filter.
您可以在 struts.xml
中使用以下内容:
You can use the following in your struts.xml
:
<constant name="struts.action.excludePattern" value="/YourServlet"/>
您可以通过逗号分隔来排除多个模式,例如:
You can exclude multiple patterns by separating them with a comma, such as:
<constant name="struts.action.excludePattern" value="/YourServlet,/YourOtherServlet"/>
更多信息
这篇关于如何在 Struts2 中使用 Servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文