2015-1-10 19:20:12 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
警告: No configuration found for the specified action: 'hello/sum' in namespace: '/hello'. Form action defaulting to 'action' attribute's literal value.
2015-1-10 19:20:13 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
struts.xml:
若要让上述警告消失,修改jsp中的form标签的属性:
警告: No configuration found for the specified action: 'hello/sum' in namespace: '/hello'. Form action defaulting to 'action' attribute's literal value.
2015-1-10 19:20:13 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
警告: No configuration found for the specified action: 'hello/sum' in namespace: '/hello'. Form action defaulting to 'action' attribute's literal value.
这里系统采用偷懒的方式,只是在package的namespace为"/hello"下面查看是否有name为“hello/sum”的action,没有,就会显示上述警告,而实际运行时,会解析action的路径来查找对应的jsp页面,所以不会影响系统运行。
原始jsp代码:
求代数和. <br>
<s:form action = "hello/sum" method = "post">
<s:textfield name = "v1" label = "操作数1"/>
<s:textfield name = "v2" label = "操作数2"/>
<s:submit value = "求和"/>
</s:form>
struts.xml:
<package name="default" namespace="/hello" extends="struts-default">
<action name="test" class="com.lijie.test.HelloWorld">
<result name = "success" type="dispatcher">/hello.jsp</result>
<result name = "positive">/positive.jsp</result>
<result name = "negative">/negative.jsp</result>
</action>
<action name="sum" class="com.lijie.test.FirstAction">
<result name = "positive">/positive.jsp</result>
<result name = "negative">/negative.jsp</result>
</action>
</package>
若要让上述警告消失,修改jsp中的form标签的属性:
<s:form action = "sum" method = "post" namespace = "/hello">
这样系统可以在/hello下查找到name为sum的action,就不会出现警告信息了。