读书人

关于struts的 errorKey属性解决方法

发布时间: 2012-01-07 21:41:55 作者: rapoo

关于struts的 errorKey属性
<html:text errorKey= "test " property= "username " />

errorKey到底怎么用的啊?搜了一下都是一些“添加了新属性errorkey,errorstyle, errorstyleclass”但是却没有搜到怎么用的。

<html:errors property= "test "/> 当然可以显示,但我用
<html:text errorKey= "test " property= "username " /> 就没什么反应了,请高手指教它的用法

文档是这么解释的:
<p> Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the <code> Globals.ERROR_KEY </code> constant string will be used. </p> <p> <strong> N.B. </strong> This is used in conjunction with the <code> errorStyle </code> , <code> errorStyleClass </code> and <code> errorStyleId </code> attributes and should be set to the same value as the <code> name </code> attribute on the <html:errors/> tag. </p> <dl> <dt> <b> Since: </b> </dt> <dd> Struts 1.2.5 </dd> </dl>

照它的意思,应该和 <html:error 差不多用法

[解决办法]
html:text中
好象没有errorKey属性

读书人网 >Java Web开发

热点推荐