警告: No configuration found for the specified action: 'hello/sum' in namespace: '/hello'. Form action

来源:互联网 发布:做淘宝要交多少钱 编辑:程序博客网 时间:2024/05/12 06:24
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

警告: 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,就不会出现警告信息了。


0 0