更改struts令牌重新提交操作页面错误的错误消息

时间:2014-08-11 07:14:52

标签: java jsp struts2

<action name="manual_order" class="materialTypeMasterAction" method="enquiry_process">
    <interceptor-ref name="token"></interceptor-ref>
    <interceptor-ref name="defaultStack"></interceptor-ref> 

    <result name="success">/pages/procurement/EnquiryDetails.jsp</result>
    <result name="invalid.token">/pages/procurement/EnquiryDetails.jsp</result> 
</action>

我想更改此invalid.token错误消息。我在哪里可以更改该消息。

2 个答案:

答案 0 :(得分:0)

invalid.token的消息资源键是

struts.messages.invalid.token=The form has already been processed or no token was supplied, please try again.
struts.internal.invalid.token=Form token {0} does not match the session token {1}.

您可以使用此消息键更改invalid.token消息。

答案 1 :(得分:0)

您可以在struts here中看到struts.messages的列表。只修改struts-messages.properties

struts.messages.invalid.token=The form has already been processed or no token was supplied, please try again.
struts.internal.invalid.token=Form token {0} does not match the session token {1}.