Struts2几种传值

 1.url向action传值

url为

http://localhost/txyl/teacher_info?method:teacher_info&teacher_seq=dedafdsf322124few 

action中取值为

import org.apache.struts2.ServletActionContext;
 
String teacher_seq = ServletActionContext.getRequest().getParameter("teacher_seq"); 

2.JSP

session.setAttribute("user",user); 

3..java

ActionContext.getContext().getSession().put("chapter_id",chapter_id);  

 

posted @ 2014-08-10 10:07  商商-77  阅读(108)  评论(0编辑  收藏  举报