请教:JSF页面传递参数,后如何显示出来? 在方法里取到能取到ID这条详细信息吗?如果不能取到,就要在方法中把属于这条ID的信息取出来,然后转交给页面显示。如果能取到,就是你详细页面取出来时有错误。把页面上取方法代码贴出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在页面上可以取道ID的信息并且从数据库中能将这个对象的相关的其他字段的值都取得到 public String Particular() { try{ FacesContext context = FacesContext.getCurrentInstance(); String aid = context.getExternalContext().getRequestParameterMap().get("aid").toString(); System.out.println("aid=aid======="+aid); AssetLogic assetLogic = new AssetLogic(); Asset asset= new Asset(); asset = (Asset)assetLogic.findById(Long.valueOf(aid)); System.out.println(asset.getCode()); this.currentState.setCurrentObject(assetLogic.findById(Long.valueOf(aid))); return "AssetDisplay"; }catch(Exception ex) { ex.printStackTrace(); } return "AssetDisplay"; } 可以了,因为在定义转向的时候,我用了redirect 利用session检测对象 Hibernate 无法解析HSQL的命名参数问题 我用STRUTS2 做的网站 <welcome-file>是个空页面跳转到一个action 然后在转到首页 一个实体类的问题 struts问题!急,谢谢各位! 一个Struts的小问题 我的WEBLOGIC服务启动不起来了! 怎样深度克隆一个ResultSet对象?? 关于Validator 验证框架的几个问题求教 有没有什么酒店应用的开源软件,进者有分。 帮忙看看log4j,我配置不好 j2ee
{
try{
FacesContext context = FacesContext.getCurrentInstance();
String aid = context.getExternalContext().getRequestParameterMap().get("aid").toString();
System.out.println("aid=aid======="+aid);
AssetLogic assetLogic = new AssetLogic();
Asset asset= new Asset();
asset = (Asset)assetLogic.findById(Long.valueOf(aid));
System.out.println(asset.getCode());
this.currentState.setCurrentObject(assetLogic.findById(Long.valueOf(aid)));
return "AssetDisplay";
}catch(Exception ex)
{
ex.printStackTrace();
}
return "AssetDisplay";
}