我在jsp中使用
<html:errors property="code" />
但是出现错误是什么没有MessageResource key .
我看struts api 时候,告诉我什么error.head , error.foot , error.sufix , error.pref 什么的。不懂
请那位指点一下,怎么使用html:errors ?
------解决方法--------------------------------------------------------
页面中只需<html:errors/>就可以了。
另外你提的问题不是很具体,不知你在action中(或者actionForm)中是什么情况。
------解决方法--------------------------------------------------------
你有没有在你的配置文件applicationproperty.properties文件中定义你的错误
------解决方法--------------------------------------------------------
errors.header=<hr><h3>Errors</h3><ul>
errors.footer=</ul><hr>
error.login.failed=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>Login Failure!</b> Please confirm your UserID and password !<br></font></center>
user.exist=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red">User: <b>{0}</b> exists!<br></font></center>
userID.requied=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>UserID</b> is required !<br></font></center>
password.required=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>Password</b> is required !<br></font></center>
userID.shorter.than.50=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>UserID</b> must be shorter than 50!<br></font></center>
password.shorter.than.8=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>Password</b> must be shorter than 8!</font></center>
room.exist=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red">Room NO.: <b>{0}</b> exists!<br></font></center>
ip.exist=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red">IP : <b>{0}</b> exists!<br></font></center>
password.not.match=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red">Old Password Not Match !<br></font></center>
operatorId.requied=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>operatorId</b> is required !<br></font></center>
operatorId.shorter.than.50=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>operatorId</b> must be shorter than 50!<br></font></center>
operatorId.exist=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red">operatorId: <b>{0}</b> exists!<br></font></center>
password.different=<center><font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>password</b> is different !<br></font></center>