Struts2 如何覆盖struts.messages.error.file.too.large属性

Struts2 如何覆盖struts.messages.error.file.too.large属性,struts2,Struts2,我正在使用Struts2 fileUpload拦截器上载文件。我已配置maxSize,允许的内容类型。。。道具等,但当用户违反最大尺寸。。。Struts2显示非常长的字符串错误消息 我想更改消息字符串,即如何覆盖struts.messages.error.file.too.large。。。有什么想法吗 谢谢 您可以在现有的消息资源.properties文件中为类或全局定义自定义错误消息: struts.messages.error.uploading=Upload error. struts.m

我正在使用Struts2 fileUpload拦截器上载文件。我已配置maxSize,允许的内容类型。。。道具等,但当用户违反最大尺寸。。。Struts2显示非常长的字符串错误消息

我想更改消息字符串,即如何覆盖struts.messages.error.file.too.large。。。有什么想法吗


谢谢

您可以在现有的消息资源.properties文件中为类或全局定义自定义错误消息:

struts.messages.error.uploading=Upload error.
struts.messages.error.file.too.large=Uploaded file was too large.
struts.messages.error.content.type.not.allowed=File type is not allowed.
struts.messages.error.file.extension.not.allowed=File extension is not allowed.
如果您当前没有使用.properties文件来存储文本,文档中有一个关于使用和配置的好章节