资源简介
使用SSH框架搭建一个OA办公系统
代码片段和文件信息
package com.bf.action.dep;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.RequestAware;
import com.bf.common.PageView;
import com.bf.po.dep.Department;
import com.bf.po.module.Module;
import com.bf.service.dep.DepService;
import com.bf.service.dep.DepServiceFinder;
public class DepAction implements RequestAware {
@Resource(name=“depServiceFinderImpl“)
private DepServiceFinder dfr;
@Resource(name=“depServiceImpl“)
private DepService df;
private List deps=new ArrayList();
protected Mapject> request;
private Department department=new Department();
private int depId;
private String type;
//��ʾ��
public String showTree(){
deps=dfr.findAll(Department.class “from Department d where d.flag=1“);
//System.out.println(deps.size());
request.put(“depAll“ deps);
return “index“;
}
//��ʾ���ҳ��
public String showAddDep(){
deps=dfr.findAll(Department.class “from Department d where d.flag=1“);
return “showAddDep“;
}
//���Ӳ���
public String addDep(){
int pid=department.getDep_id();
System.out.println(pid);
department.setFlag(1);
df.addDep(department pid);
return “addDep“;
}
//ɾ������
public String deleteDep(){
df.deleteByLogic(Department.class new Serializable[]{depId} “dep_id“ “flag“);
return “deleteDep“;
}
//��ʾ��Ϣ
public String findByPage(){
int pageNo=0;
String pageNo_str=ServletActionContext.getRequest().getParameter(“pager.offset“);
if(pageNo_str!=null){
pageNo=Integer.parseInt(pageNo_str);
}
int pageSize=5;
PageView pv=null;
if(type!=null&&!type.equals(““)){
pv=dfr.findByPage(Department.class “from Department d where d.dep_name=?“type pageNo pageSize);
}else{
pv=dfr.findByPage(Department.class “from Department d“ pageNo pageSize);
}
request.put(“pv“ pv);
return “findByPage“;
}
//�õ���Ӧ�Ӳ�����Ϣ
public String execute() throws IOException{
HttpServletRequest request=ServletActionContext.getRequest();
HttpServletResponse response=ServletActionContext.getResponse();
int pid=0;
//ͨ��pid��ȡ����Ӧ��ֵ
String pid_str=request.getParameter(“pid“);
if(pid_str!=null){
pid=Integer.parseInt(pid_str);
}
//�建��
response.setHeader(“Pragma“ “no-cache“);
response.setHeader(“Cache-Control“ “no-cache“);
response.setCharacterEncoding(“UTF-8“);
response.setContentType(“text/xml;charset=utf-8“);
//��װxml
List subDeps=dfr.findAll(Department.class “from Department d where d.parent.dep_id=“+pid);
PrintWriter out=response.getWriter();
out.pri
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-06-13 09:35 BFoa\
文件 4451 2017-06-05 15:54 BFoa\.classpath
文件 1179 2017-06-02 15:54 BFoa\.project
目录 0 2017-06-13 09:35 BFoa\.settings\
文件 567 2017-04-06 21:00 BFoa\.settings\.jsdtscope
文件 111 2017-05-22 10:05 BFoa\.settings\org.eclipse.core.resources.prefs
文件 598 2017-06-05 15:54 BFoa\.settings\org.eclipse.jdt.core.prefs
文件 464 2017-04-06 21:00 BFoa\.settings\org.eclipse.wst.common.component
文件 305 2017-06-02 15:53 BFoa\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-04-06 21:00 BFoa\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-04-06 21:00 BFoa\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1181 2017-04-13 21:39 BFoa\1
文件 202 2017-04-27 09:33 BFoa\2.txt
目录 0 2017-06-13 09:35 BFoa\WebContent\
目录 0 2017-06-13 09:35 BFoa\WebContent\me
文件 39 2017-04-06 21:00 BFoa\WebContent\me
目录 0 2017-06-13 09:35 BFoa\WebContent\WEB-INF\
文件 641 2017-05-11 16:22 BFoa\WebContent\WEB-INF\bf.tld
目录 0 2017-06-13 09:35 BFoa\WebContent\WEB-INF\lib\
文件 493 2017-04-18 15:09 BFoa\WebContent\WEB-INF\lib\.jsdtscope
文件 445288 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\antlr-2.7.7.jar
文件 43578 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\asm-3.3.jar
文件 38275 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\asm-commons-3.3.jar
文件 21503 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\asm-tree-3.3.jar
文件 242154 2017-05-27 16:57 BFoa\WebContent\WEB-INF\lib\bsh.jar
文件 610790 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\c3p0-0.9.1.2.jar
文件 326877 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\com.springsource.net.sf.cglib-2.2.0.jar
文件 4615 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\com.springsource.org.aopalliance-1.0.0.jar
文件 1642154 2017-03-22 21:34 BFoa\WebContent\WEB-INF\lib\com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar
文件 559366 2017-06-02 17:13 BFoa\WebContent\WEB-INF\lib\commons-collections-3.1.jar
文件 121757 2017-06-02 11:00 BFoa\WebContent\WEB-INF\lib\commons-dbcp.jar
............此处省略463个文件信息
评论
共有 条评论