请教高手!!!!!web.xml中的配置:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/applicationContext*.xml</param-value>
</context-param>
<listener>
<description>配置spring监听器</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<description>配置struts的过滤器</description>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>
struts-default.xml,struts-plugin.xml,/config/common-action.xml
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>common-action.xml中的配置:
<struts>
<package name="common" extends="struts-default">
<action name="test" class="studentAction" method="init">
<result name="toMainFrame">/jsp/common/frame.jsp</result>
</action>
</package>
</struts>
index.jsp:
<body>
<s:form action="test.actioin" method="post">
<s:textfield name="name" label="请输入一个字符窜"/>
<s:submit value="提交"/>
</s:form>
</body>
服务器启动正常,但在运行的时候总页面包一下错:
HTTP Status 404 - /school_MIS/test.action 。
在后台总是提示:
2010-6-17 22:15:24 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'test.actioin' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
2010-6-17 22:15:24 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'test.actioin' in namespace: ''. Form action defaulting to 'action' attribute's literal value.注:上述的common-action.xml为struts2的配置文件,位于WEB-INF/config/common-action.xml.曾试过好几次将其配置路径改为 /WEN-INF/config/common-action.xml 或 ../config/common-action.xml都包同样的错。困惑了好几天了,肯请高手帮忙,再次拜谢!
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/applicationContext*.xml</param-value>
</context-param>
<listener>
<description>配置spring监听器</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<description>配置struts的过滤器</description>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>
struts-default.xml,struts-plugin.xml,/config/common-action.xml
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>common-action.xml中的配置:
<struts>
<package name="common" extends="struts-default">
<action name="test" class="studentAction" method="init">
<result name="toMainFrame">/jsp/common/frame.jsp</result>
</action>
</package>
</struts>
index.jsp:
<body>
<s:form action="test.actioin" method="post">
<s:textfield name="name" label="请输入一个字符窜"/>
<s:submit value="提交"/>
</s:form>
</body>
服务器启动正常,但在运行的时候总页面包一下错:
HTTP Status 404 - /school_MIS/test.action 。
在后台总是提示:
2010-6-17 22:15:24 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'test.actioin' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
2010-6-17 22:15:24 org.apache.struts2.components.Form evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: 'test.actioin' in namespace: ''. Form action defaulting to 'action' attribute's literal value.注:上述的common-action.xml为struts2的配置文件,位于WEB-INF/config/common-action.xml.曾试过好几次将其配置路径改为 /WEN-INF/config/common-action.xml 或 ../config/common-action.xml都包同样的错。困惑了好几天了,肯请高手帮忙,再次拜谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货