现在的位置: 首页 > 综合 > 正文

javabean向传jsp传值

2018年06月30日 ⁄ 综合 ⁄ 共 556字 ⁄ 字号 评论关闭

struts-config:

 

<action path="/articleManage" name="articleManageForm"  scope="request" type="auction.action.ArticleManageAction" validate="false">
   <forward name="atriclesList" path="/WEB-INF/publish/articleManage/atriclesList.jsp"/>
   <forward name="registerGood" path="/WEB-INF/publish/articleManage/registerGood.jsp"/>
</action>

 

Action:

 

ArticleManageForm theForm = new ArticleManageForm ();

theForm = theOperation.getInfo(request.getParameter("noId"));
 request.setAttribute("articleManageForm", theForm);

 

 1、配置的bean的名称要和struts-config中的一样

 2、在bean中写一个方法,将取出的数据放到相应的bean的变量中

抱歉!评论已关闭.