常言笑的家

Spring, Hibernate, Struts, Ajax, RoR

Struts Action 中ActionForward问题

1、第一种方法
 
 1 private  ActionForward encompetedataSelect(ActionForm form, HttpServletRequest request, HttpServletResponse response)  {
 2   HttpSession _session  =  request.getSession();
 3   Engineermarket em  =   new  Engineermarket();
 4   em  =  (Engineermarket)_session.getAttribute( " engineermarket " );
 5    if ( null == em)  {
 6    ActionForward file  =   new  ActionForward( " engineermarket.do?actionType=engineermkChange&actionName=encompetedata " true );
 7     return  file;
 8   }
  else   {
 9    String hql  =   " from Encompetedata where engineermarket.id=' " + em.getId() + " ' " ;
10    List list  =  (List)encompetedataServiceI.getEncontentBySql(hql);
11    _session.setAttribute( " encompetedataResult " ,list);
12    ActionForward file  =   new  ActionForward( " /jsp/engineer/encompetedataList.jsp " true );
13     return  file;
14   }

15  }
 
2、第二种方法
1 private  String encompetedataEditForm(ActionForm form, HttpServletRequest request, HttpServletResponse response)  {
2   Integer rid  =   null ;
3   rid  =   new  Integer(request.getParameter( " ID " ));
4   request.setAttribute( " model " , encompetedataGet(rid));
5   request.setAttribute( " actionType " " encompetedataMod " );
6    return   " encompetedataForm " ;
7  }

posted on 2006-12-16 22:56 常言笑 阅读(998) 评论(0)  编辑  收藏 所属分类: JAVA/J2EE


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


网站导航:
 

My Links

Blog Stats

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜