日期:2014-05-20 浏览次数:20730 次
<body>
<a href="job.action?method=listSkill">显示工作列表</a>
<a href="edit.jsp">创建/编辑</a>
</body>
<struts>
<constant name="struts.devMode" value="true"/>
<package name="default" namespace="/" extends="struts-default">
<action name="job" class="action.JobAction" method="listSkill">
<result name="success">/listSkill.jsp</result>
</action>
<action name="job" class="action.JobAction" method="create">
<result name="success">/listSkill.jsp</result>
</action>
<action name="job" class="action.JobAction" method="assign">
<result name="success">/edit.jsp</result>
</action>
</package>
</struts>
package action;
import bean.Job;
import java.util.*;
import com.opensymphony.xwork2.ActionSupport;
@SuppressWarnings("serial")
public class JobAction extends ActionSupport{
private Job job;
private int id;
private static List<Job> list = new ArrayList<Job>();
public Job getJob() {
return job;
}
public void setJob(Job job) {
this.job = job;
}
public List<Job> getList() {
return list;
}
public void setList(List<Job> list) {
this.list = list;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String listSkill(){
System.out.print(list.size()+"list=====@@@@@@@@@@@@@@@");
return "success_list";
}
public String create(){
System.out.print(job.getDescribe());
list.add(job);
return "success_create";
}
public String edit(){