
struts2的validation的错误返回给action时怎么显示出来?
<actionname="hello2"class="com.Hello"method="add"><interceptor-refname="defaultStack"...
<action name="hello2" class="com.Hello"
method="add">
<interceptor-ref name="defaultStack" />
<result name="input" >/MyJsp.jsp</result>
<result name="success" >/MyJsp.jsp</result>
</action>
就能显示错误,因为返回给的是jsp
<action name="hello" class="com.Hello"
method="add">
<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了。
这个怎么搞?求解 展开
method="add">
<interceptor-ref name="defaultStack" />
<result name="input" >/MyJsp.jsp</result>
<result name="success" >/MyJsp.jsp</result>
</action>
就能显示错误,因为返回给的是jsp
<action name="hello" class="com.Hello"
method="add">
<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了。
这个怎么搞?求解 展开
展开全部
这个、这个、应该能显示了啊你已经用了链式了....要不你在 hello1中也添加chain试试?
其实我想过这样一个问题...既然hello返回还要调用action 那还返回干嘛 直接在add()的后面直接调用hello1的执行方法就好了..然后让他放回..还少了一步
其实我想过这样一个问题...既然hello返回还要调用action 那还返回干嘛 直接在add()的后面直接调用hello1的执行方法就好了..然后让他放回..还少了一步
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询