【发布时间】:2012-01-02 11:30:18
【问题描述】:
我无法在 struts.my web.xml 配置文件中制作模块,其中包含以下配置:
web.xml
<init-param>
<param-name>config/admin</param-name>
<param-value>/WEB-INF/config/struts-config-admin.xml</param-value>
</init-param>
我在 struts-config-admin.xml 中的操作配置是
<action path="/userAdminAction" type="com.admin.UserAdminAction"
............
</action>
JSP:searchLayout.jsp
<html:html>
<html:form action="admin/userAdminAction.do" method="get">
..............
..............
..............
submit button to submit the form
</html:form>
我正在使用 url 从地址栏中调用 jsp http://localhost/snpapp/admin/searchLayout.jsp
但我得到以下异常堆栈跟踪: ServletException 的原因。
servlet.jsp.JspException: Cannot retrieve mapping for action: "/admin /userAdminAction"
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:840)
在 org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:467) 在 jsp_servlet._lrd.search._searchLayout.jsp_tag7(__searchLayout.java:438)
我在 jsp 的表单操作中尝试了不同的操作(例如:action="/userAdminAction" 或 action="userAdminAction.do"),但它不适用于模块。
请给我一些想法。我怎样才能实现 struts 模块应该适用于表单?
【问题讨论】:
标签: java struts struts-1 struts-config struts-html