struts1如何将form中的值显示到jsp页面中 form中定义了一个实体 在action中set实体的值 怎么用<bean:write>将实体中的属性显示到jsp页面中 我用的<bean:write name="entity" property="entName"/>取不出来 求大神指教!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你在action中,有把这个实体,放入 request 或 session 中么?可以指定你实体存放的域,比如: <bean:write name="entity" property="entName" scope="request"/>相当于(这里忽略了类型转换): <%=request.getAttribute("neeke").getEntName()%> 在form中这样定义一个实体 private BusNonsealdetails entity = new BusNonsealdetails(); public BusNonsealdetails getEntity() { return entity; } public void setEntity(BusNonsealdetails entity) { this.entity = entity; } 在action中给实体赋值public ActionForward goLook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { BusNonsealdetailsForm bForm =(BusNonsealdetailsForm)form; bForm.setEntity(service.getBusNonsealdetailsById(bForm.getPkId()));// BusNonsealdetails bn = service.getBusNonsealdetailsById(bForm.getPkId());// request.setAttribute("bn", bn); return mapping.findForward("toLook");}在jsp页面中怎样把entity中的属性entName取出来?? Action中至少要: request.setAttribute("entity", bForm.getEntity); 那样的话就不需要用form了吧 直接用request.setAttribute("entity", entity);就行了啊 formbean作用把页面的值放到formbean中,然后传给action,返回的时候,不使用formbean hibernate3 添加实体的问题 求救:在eclipse里写的HTML代码出现Undefined attribute name (PLUGINSPAGE) 同一台服务器部署两个网站后出现的诡异的问题 急求SqlService2000,MyEclipse5.5的中文使用说明书 tomcat启动出现多个严重,请解析详细点 兄弟们!!帮啊,我有小三阳,要怎么样检查不出乙肝啊 有什么简单的办法来解决? 关于时间的问题 这段向数据库中插入数据的程序有错么? 关于在线支付的问题 求帮忙,谢谢各位大神了! 200分求大家解决jasperreport通过APPLET客户端打印
<bean:write name="entity" property="entName" scope="request"/>
相当于(这里忽略了类型转换):
<%=request.getAttribute("neeke").getEntName()%>
private BusNonsealdetails entity = new BusNonsealdetails();
public BusNonsealdetails getEntity()
{
return entity;
}
public void setEntity(BusNonsealdetails entity)
{
this.entity = entity;
}
在action中给实体赋值
public ActionForward goLook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
BusNonsealdetailsForm bForm =(BusNonsealdetailsForm)form;
bForm.setEntity(service.getBusNonsealdetailsById(bForm.getPkId()));
// BusNonsealdetails bn = service.getBusNonsealdetailsById(bForm.getPkId());
// request.setAttribute("bn", bn);
return mapping.findForward("toLook");
}在jsp页面中怎样把entity中的属性entName取出来??
request.setAttribute("entity", bForm.getEntity);