struts2.0中namespace问题及解决方法

上一篇 / 下一篇  2011-01-07 09:50:15

   在struts.xml中配置了namespace="/"但是在页面上的form中没有配置namespace="/",然后运行就出现了:org.apache.struts2.components.Form. evaluateExtraParamsServletRequest
警告: No configuration found for the specified action: '****' in namespace: ''. Form. action defaulting to 'action' attribute's literal value.。

解决办法总结下:

一:如果jsp页面用的struts2标签,则xml中有namespace,页面的form中也必须有namespace同时form提交时那个action可以直接写xml中的<action name="login" class="action.LoginAction">中的name属性的值,不需要加.action,如果有namespace的话

二:如果jsp页面用的struts1标签,则form提交时那个action必须写上action的绝对路径,如:/login.action,需要加.action,和namespace。



TAG:

 

评分:0

我来说两句

Open Toolbar