<action name="hello" class="com.hello"
method="addColumn">
<interceptor-ref name="defaultStack" />
<result name="input" type="chain">hello1</result>
<result name="success" type="chain">hello1</result>
</action>
<action name="hello1">
<interceptor-ref name="defaultStack" />
<result name="input">/MyJsp.jsp</result>
<result name="success">/MyJsp.jsp</result>
</action>
<action name="hello2" class="com.hello"
method="addColumn">
<interceptor-ref name="defaultStack" />
<result name="input" >/MyJsp.jsp</result>
<result name="success" >/MyJsp.jsp</result>
</action>在上面的那个配置中,访问hello2.action能够打印出<s:actionerror /><s:fielderror cssStyle="color:red" />,但是访问hello.action就是不行,求解,或者用其它方法解决这个问题也行,谢谢!
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>11111</title>
<s:head />
</head>
<body>
<s:actionerror />
<s:fielderror cssStyle="color:red" />
<s:property value="errors.groupName" />
<s:debug></s:debug>
</body>
</html>
高手看看怎么搞,谢谢啊
2:addColumn方法返回 input 或 sucess 根据返回值判断跳转哪一页(<result name=''/>)
3: 假设第一次<action name='hello'/>中返回成功-->跳转hello1
4:hello1中result 也是要求返回值判断的。没的明确的返回值转哪个?
5:我记得result有个不用name属性的。
<interceptor-ref name="defaultStack" />
<result name="input">/MyJsp.jsp</result>
<result name="success">/MyJsp.jsp</result>
</action>action 还可以不写class 和 method ?我没这么做过啊,你加上试试还有没有错!你执行了hello.action后调用hello1.action是为了做什么呢?跳转到MyJsp.jsp页面吗?这样可以像hello2那种配置啊!