资源简介

适合学生的javaee课程设计代码,采用MVC模式开发……

资源截图

代码片段和文件信息

package whb.controller;

import java.io.File;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import whb.domain.StudentBean;
import whb.form.StudentInfoForm;
import whb.service.StudentDaoService;
import whb.service.impl.StudentDaoSerciceImpl;
import whb.util.BeanUtil;

import com.opensymphony.xwork2.ActionSupport;

public class AddStudentServlet extends ActionSupport implements SessionAware
ServletRequestAware ServletResponseAware  {
/**
 * 
 */
private static final long serialVersionUID = 1L;
private StudentInfoForm s ;
private File photo ;
private String photoFileName; //文件名称    
private String photoContentType; //文件类型
private Map session;
private HttpServletRequest request;
private HttpServletResponse response;

private String existError;
private String notAdminError;

@Override
public String execute(){
existError = ““;
notAdminError = ““;
request.setAttribute(“existError“ existError);
request.setAttribute(“notAdminError“ notAdminError);
if(session.get(“admin“)!=null){
StudentDaoService service = new StudentDaoSerciceImpl();
StudentBean student = new StudentBean();
BeanUtil.copyBean(student s photo);
service.addStudent(student);
request.setAttribute(“tipMessage“ “添加“+s.getName()+“学生信息成功!“);
return SUCCESS;
}
notAdminError=“并不是管理员省份,请重新登录!!“;
return “gotoIndex“;
}




public void setSession(Map session) {
this.session = session;
}

public void setServletRequest(HttpServletRequest request) {
this.request = request;
}

public void setServletResponse(HttpServletResponse response) {
this.response = response;
}

public String getPhotoFileName() {
return photoFileName;
}
public void setPhotoFileName(String photoFileName) {
this.photoFileName = photoFileName;
}
public String getPhotoContentType() {
return photoContentType;
}
public void setPhotoContentType(String photoContentType) {
this.photoContentType = photoContentType;
}
public StudentInfoForm getS() {
return s;
}
public void setS(StudentInfoForm s) {
this.s = s;
}
public File getPhoto() {
return photo;
}
public void setPhoto(File photo) {
this.photo = photo;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-07-06 20:31  studentSystem\
     文件         834  2013-05-31 16:04  studentSystem\.classpath
     文件        1046  2013-05-31 16:04  studentSystem\.project
     目录           0  2013-07-06 20:31  studentSystem\.settings\
     文件         503  2013-05-31 16:04  studentSystem\.settings\.jsdtscope
     文件         163  2013-06-09 15:30  studentSystem\.settings\org.eclipse.core.resources.prefs
     文件         395  2013-05-31 16:04  studentSystem\.settings\org.eclipse.jdt.core.prefs
     文件         491  2013-05-31 16:04  studentSystem\.settings\org.eclipse.wst.common.component
     文件         345  2013-05-31 16:04  studentSystem\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2013-05-31 16:04  studentSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2013-05-31 16:04  studentSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2013-07-06 20:31  studentSystem\WebContent\
     目录           0  2013-07-06 20:31  studentSystem\WebContent\meta-INF\
     文件          39  2013-05-31 16:04  studentSystem\WebContent\meta-INF\MANIFEST.MF
     目录           0  2013-07-06 20:31  studentSystem\WebContent\WEB-INF\
     目录           0  2013-07-06 20:31  studentSystem\WebContent\WEB-INF\lib\
     文件       43578  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\asm-3.3.jar
     文件       38275  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\asm-commons-3.3.jar
     文件       21503  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\asm-tree-3.3.jar
     文件       59590  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\commons-fileupload-1.2.2.jar
     文件      159509  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\commons-io-2.0.1.jar
     文件      279193  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\commons-lang-2.5.jar
     文件      924269  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\freemarker-2.3.18.jar
     文件      614203  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\javassist-3.11.0.GA.jar
     文件      305375  2013-06-09 15:25  studentSystem\WebContent\WEB-INF\lib\jcommon-1.0.9.jar
     文件     1291498  2013-06-09 15:25  studentSystem\WebContent\WEB-INF\lib\jfreechart-1.0.9.jar
     文件       16905  2013-05-30 20:12  studentSystem\WebContent\WEB-INF\lib\jstl.jar
     文件      495944  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\mysql-connector-java-5.0.4-bin.jar
     文件      227823  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\ognl-3.0.4.jar
     文件      508651  2013-05-30 20:12  studentSystem\WebContent\WEB-INF\lib\standard-1.0.6.jar
     文件      775017  2013-05-31 17:18  studentSystem\WebContent\WEB-INF\lib\struts2-core-2.3.1.2.jar
............此处省略143个文件信息

评论

共有 条评论