`
pity1115
  • 浏览: 32208 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
最近访客 更多访客>>
社区版块
存档分类
最新评论

JSF参数传递方式之四:f:attribute标签传递

    博客分类:
  • JSF
阅读更多
页面到Bean的参数传递
页面中设置参数:
<h:form>
			<h:commandButton action="#{paramBean.test3}" value="Test11" actionListener="#{paramBean.changeName}">
				<f:attribute name="name" value="hujilie"/>
			</h:commandButton>
			<h:commandLink action="#{paramBean.test3}" value="Test12" actionListener="#{paramBean.changeName}">
				<f:attribute name="name" value="hujilie"/>
			</h:commandLink>
	</h:form>
后台取参数:
public void changeName(ActionEvent e)
    {
        UIComponent component = e.getComponent();
        Map<String, Object> map = component.getAttributes();
        setName((String)map.get("name"));
    }
分享到:
评论
1 楼 yourenyouyu2008 2009-07-23  
总结的太详细了,对jsf的了解的相当深入。

相关推荐

Global site tag (gtag.js) - Google Analytics