【www.gdgbn.com--Action】

HTML Tags
一些公用的tag attributes在HTMLTagLib里的含义前后一致,它们是
name: ActionForm bean的实例名,如果name不存在,所关联的formBean会生效。
property: property既决定了生成的html的fieldname,也决定了该field的值 via formBean.getThisProperty
value: value决定了生成html的field的value,注意它不是bean的propertyName
和普通不同的是,1)自动加上hidden token 2)自动加上context_root
剩下的以后慢慢加。。。
消息(错误)显示
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("userForm.insert", info.getUserName());
messages.add("activationDate", new ActionMessage("userForm.active", info.getDateLength());
如下可以显示所有消息,并用将它们放入一个list,再加上可定制的header/footer



如下可以指定只显示某种message
apache.struts.action.ActionMessages.GLOBAL_MESSAGE %>">


把Messages换成Errors就是错误显示,为了简便,经常一个了事

本文来源:http://www.gdgbn.com/flash/5589/