当前页面: 开发资料首页 → J2EE 专题 → J2EE学习笔记(6) Struts HTML Tags
摘要: J2EE学习笔记(6) Struts HTML Tags
HTML Tags
一些公用的tag attributes在HTMLTagLib里的含义前后一致,它们是
name: ActionForm bean的实例名,如果name不存在,
property: property既决定了生成的html的fieldname,也决定了该field的值 via formBean.getThisProperty
value: value决定了生成html的field的value,注意它不是bean的propertyName
剩下的以后慢慢加。。。
消息(错误)显示
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("userForm.insert", info.getUserName());
messages.add("activationDate", new ActionMessage("userForm.active", info.getDateLength());
如下可以显示所有消息,并用