Struts结果错误映射错误 [英] Struts Result Error mapping error

查看:88
本文介绍了Struts结果错误映射错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在我的动作类中,当引发异常时,我已将结果类型错误传递给struts.xml。

动作类中的返回值是错误。



在我的struts.xml中返回类型错误我指出了一个带有显示操作错误消息的jsp。

映射值struts.xml是错误的。



但问题是,当异常被提出时,它指向带有错误消息的错误JSP。但是伴随着错误消息,它也显示在消息之下。



没有为行动MYActioncalss和结果错误定义结果。



我想知道在动作类和strut.xml文件中我已将结果类型映射为ERROR,但在错误消息中它显示错误。



你可以帮助找到问题中的错误。

Hi
In my action class i have passed the result type error to struts.xml when an exception raised .
Return value in action class is ERROR.

In my struts.xml for the return type error i have pointed a jsp with displaying action error message.
Mapping value in struts.xml is ERROR.

But the problem is, as exception is raised it points to error JSP with error message. But along with error message it also dispaly below message.

"No result defined for action MYActioncalss and result error".

I am wondering in both action class and strut.xml file i have mapped the result type as "ERROR" but in the error message it shows me "error".

can u help to find the fault in the issue.

推荐答案

解决了这个问题。



如果我在动作类中映射了结果类型ERROR,那么它只将值传递给struts作为错误。

如果我在动作类中映射结果类型ERROR,那么它将值传递给struts仅为ERROR。



差异
solved the issue.

If i mapped result type ERROR in action class then it passes the value to struts as "error" only.
If i mapped result type "ERROR" in action class then it passes the value to struts as "ERROR" only.

Thats the difference


这篇关于Struts结果错误映射错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆