posts - 3,comments - 2,trackbacks - 0
在JSF2中,可以用 @ManagedProperty(value="#{param.id}") 获得 url地址中的参数,其中,id是参数名
url:
http://localhost:8080/myproject/test.faces?id=123
服务器端:
public class TestBean {

   
@ManagedProperty(value="#{param.id}")
   
private Long id;

   
@PostConstruct
   
public void init() {
       
System.out.println(id);
   
}
}
posted on 2010-10-28 22:41 风籁 阅读(174) 评论(0)  编辑  收藏 所属分类: JSF

只有注册用户登录后才能发表评论。


网站导航: