大家好,小弟我这几天碰到这样一个问题。
系统用的是strut2,spring整合的,
struts.xml如下:
- XML code
<package name="test1" extends='struts-default' namespace="/"> <!-- 配置Action --> <action name="index" class="indexAction"> <!-- 配置返回结果 --> <result name="success" type="freemarker">/WEB-INF/ftl/index.ftl</result> </action> <action name="login" class="loginAction"> <!-- 配置返回结果 --> [color=#FF0000]<result name="input" type="chain">index</result>[/color] <result name="success" type="freemarker">/WEB-INF/ftl/success.ftl</result> <result name="failure" type="freemarker">/WEB-INF/ftl/failure.ftl</result> </action> </package>
流程是:系统进入首页是index.action,获取首页数据后进入index.ftl。在index.ftl页面里有登录按钮login.action。
现在在index.ftl页面加入验证<@s.fielderror/>。验证后不知道怎么样才能返回到index.ftl页面提示错误提示信息,因为不能够直接转到index.ftl,而是先转到index.action里。我用<result name="input" type="chain">index</result>,
后台提示错误信息如下:
2009-3-5 12:42:21 org.apache.struts2.dispatcher.Dispatcher serviceAction
严重: Could not find action or result
No result defined for action com.winking.action.IndexAction and result input - action
但struts.xml确实是有这样的action和rusult的,大家帮忙看看哈。拜托。。
------解决方案--------------------
No result defined for action com.winking.action.IndexAction and result input - action
为index配置一个input看看
------解决方案--------------------
type="chain" 这个东西是从action跳转到action才需要的啊,你直接返回怎么会需要这个呢,
把它去掉试试