我想在Struts2中分两行显示错误信息
User Name is not valid
Password is not valid
我的属性(property)是:
username.password.errrorMsg: User Name is not valid \n Password is not valid.
我添加了 \n
但它显示在单行中。
你能建议分两行显示吗?
最佳答案
如果您使用消息格式,那么 \n
symbol 添加换行符。如果您想使用 actionerror
显示此消息或 actionmessage
您需要使用的标签 <br>
让它不要逃脱。例如
<s:actionmessage escape="false"/>
关于java - 在 struts2 messages.properties 中插入新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21232592/