Struts(2)错误 高手帮忙解决下

lei920920 2011-02-23 06:58:11
struts.xml
<struts>
<include file="struts-default.xml"></include>
<package name="struts2" extends="struts-default" namespace="/mystruts">
<action name="sum" class="action.FirstAction" >
<result name="nagetive">/nagetive.jsp</result>
<result name="positive">/positive.jsp</result>
</action>
</package>
</struts>

页面
<s:form action="sum" namespace="/mystruts">
<s:textfield name="operand1" label="操作数1"></s:textfield>
<s:textfield name="operand2" label="操作数2"></s:textfield>
<s:submit value="代数和"></s:submit>
</s:form>

2011-2-23 18:35:01 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:03 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: No configuration found for the specified action: 'sum' in namespace: '/mystruts'. Form action defaulting to 'action' attribute's literal value.
2011-2-23 18:35:22 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
...全文
83 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
ituuz 2011-02-24
  • 打赏
  • 举报
回复
还有可能是你命名空间的问题,把namespace="/mystruts"删了 试试
ituuz 2011-02-24
  • 打赏
  • 举报
回复
<form action = "sum.action">
  • 打赏
  • 举报
回复
更具你提供的信息,应该是没有问题的啊!
lei920920 2011-02-23
  • 打赏
  • 举报
回复
那位大师帮忙解决下。感激不尽!
lei920920 2011-02-23
  • 打赏
  • 举报
回复
不行 还是那个错!
redlotus_lyn 2011-02-23
  • 打赏
  • 举报
回复
<s:form action="/mystruts/sum.action">
wkcgy 2011-02-23
  • 打赏
  • 举报
回复
我以前遇到过一次这样的错误,但是现在记不清了,就是在<form>表单中添加一个namespace!在form表单中的action最好写全:xxxx.action这样最保险!!当然也可以直接把namespace加到action中。
jumpheightway 2011-02-23
  • 打赏
  • 举报
回复
namespace有错 不过不清楚建议不要配置,这个指的是文件夹的意思
lei920920 2011-02-23
  • 打赏
  • 举报
回复
为什么没有找到sum?
zljxtt 2011-02-23
  • 打赏
  • 举报
回复
没找到sum

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧