java校园二手市场源码


java实现的校园二手市场源码,适合新手参考学习的资料。直接导入java开发IDE中,如myeclipse就可以直接运行。
资源截图
代码片段和文件信息
package cn.edu.djtu.fw.action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.beans.factory.annotation.Autowired;

import cn.edu.djtu.fw.model.Admin;
import cn.edu.djtu.fw.model.Json;
import cn.edu.djtu.fw.service.AdminServiceI;
import cn.edu.djtu.fw.util.JsonUtil;

import com.opensymphony.xwork2.ActionSupport;

public class AdminAction extends ActionSupport implements ServletRequestAware {

private static final long serialVersionUID = 1L;

private String id;
private String name;
private String pwd;
private HttpServletRequest request;
private Admin admin;
private int page;
private int rows;
private String ids;

@Override
public String execute() throws Exception {
Mapject> m = new HashMapject>();
m = adminService.getAllAdmin(page rows admin);
JsonUtil.writeJson(m);
return null;
}

public String login() throws Exception {
HttpSession session = request.getSession();
Admin admin2 = new Admin();
Json j = new Json();
admin2 = adminService.login(admin);
if (admin2 != null) {
session.setAttribute(“admin“ admin2);
j.setSuccess(true);
j.setMsg(“登录成功“);
JsonUtil.writeJson(j);
return null;
} else {
j.setMsg(“登录失败“);
JsonUtil.writeJson(j);
return null;
}
}

public String loginOut() throws Exception {
HttpSession session = request.getSession();
if (session != null && session.getAttribute(“admin“) != null) {
session.invalidate();
return SUCCESS;
}
return ERROR;
}

public void add() throws Exception {
Json j = new Json();
if (adminService.insert(admin)) {
j.setSuccess(true);
j.setMsg(“添加成功!“);
} else {
j.setMsg(“添加失败!“);
}
JsonUtil.writeJson(j);
}

public void delete() throws Exception {
Json j = new Json();
String[] idsStr = ids.split(““);
for (int i = 0; i < idsStr.length; i++) {
Admin a = adminService.getAdminById(Integer.parseInt(idsStr[i]));
if (a != null) {
adminService.delete(a.getId());
}
}
j.setSuccess(true);
j.setMsg(“删除成功!“);
JsonUtil.writeJson(j);
}

public void update() throws Exception {
Json j = new Json();
if (adminService.update(admin)) {
j.setSuccess(true);
j.setMsg(“修改成功!“);
} else {
j.setMsg(“修改失败!“);
}
JsonUtil.writeJson(j);
}

private AdminServiceI adminService;

public AdminServiceI getAdminService() {
return adminService;
}

@Autowired
public void setAdminService(AdminServiceI adminService) {
this.adminService = adminService;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getPwd() {
return 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-07-23 05:16  fw
     文件         607  2015-07-23 05:16  fwREADME.md
     目录           0  2015-07-23 05:16  fwfw
     文件         727  2015-07-23 05:16  fwfw.classpath
     文件           8  2015-07-23 05:16  fwfw.gitignore
     文件        1035  2015-07-23 05:16  fwfw.project
     目录           0  2015-07-23 05:16  fwfw.settings
     文件         503  2015-07-23 05:16  fwfw.settings.jsdtscope
     文件         364  2015-07-23 05:16  fwfw.settingsorg.eclipse.jdt.core.prefs
     文件         458  2015-07-23 05:16  fwfw.settingsorg.eclipse.wst.common.component
     文件         305  2015-07-23 05:16  fwfw.settingsorg.eclipse.wst.common.project.facet.core.xml
     文件          49  2015-07-23 05:16  fwfw.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2015-07-23 05:16  fwfw.settingsorg.eclipse.wst.jsdt.ui.superType.name
     目录           0  2015-07-23 05:16  fwfwWebContent
     目录           0  2015-07-23 05:16  fwfwWebContentmeta-INF
     文件          39  2015-07-23 05:16  fwfwWebContentmeta-INFMANIFEST.MF
     目录           0  2015-07-23 05:16  fwfwWebContentWEB-INF
     目录           0  2015-07-23 05:16  fwfwWebContentWEB-INFlib
     文件        4467  2015-07-23 05:16  fwfwWebContentWEB-INFlibaopalliance-1.0.jar
     文件       53232  2015-07-23 05:16  fwfwWebContentWEB-INFlibasm-5.0.2.jar
     文件       41717  2015-07-23 05:16  fwfwWebContentWEB-INFlibasm-commons-5.0.2.jar
     文件       29037  2015-07-23 05:16  fwfwWebContentWEB-INFlibasm-tree-5.0.2.jar
     文件     1791359  2015-07-23 05:16  fwfwWebContentWEB-INFlibaspectjweaver-1.7.1.jar
     文件       69002  2015-07-23 05:16  fwfwWebContentWEB-INFlibcommons-fileupload-1.3.1.jar
     文件      173587  2015-07-23 05:16  fwfwWebContentWEB-INFlibcommons-io-2.2.jar
     文件      384767  2015-07-23 05:16  fwfwWebContentWEB-INFlibcommons-lang3-3.2.jar
     文件       62050  2015-07-23 05:16  fwfwWebContentWEB-INFlibcommons-logging-1.1.3.jar
     文件     1469339  2015-07-23 05:16  fwfwWebContentWEB-INFlibdruid-0.2.9.jar
     文件      356370  2015-07-23 05:16  fwfwWebContentWEB-INFlibfastjson-1.1.26.jar
     文件      931168  2015-07-23 05:16  fwfwWebContentWEB-INFlibfreemarker-2.3.19.jar
     文件       45024  2015-07-23 05:16  fwfwWebContentWEB-INFlibhamcrest-core-1.3.jar
............此处省略842个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)