• 大小: 898KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: Java
  • 标签:

资源简介

使用JSP作为开发语言,后台使用SQL SERVER作为数据库管理系统,开发环境是MyEclipse,服务器采用tomcat

资源截图

代码片段和文件信息

package com.action;

/**
 *  
 * 
 */
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bean.ComBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.Filter;
import com.util.SmartFile;
import com.util.SmartUpload;

public class NewsServlet extends HttpServlet {

private ServletConfig config;
/**
 * Constructor of the object.
 */
public NewsServlet() {
super();
}

final public void init(ServletConfig config) throws ServletException
    {
        this.config = config;  
    }

    final public ServletConfig getServletConfig()
    {
        return config;
    }
/**
 * Destruction of the servlet. 

 */
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}

/**
 * The doGet method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to get.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

doPost(requestresponse);
}

/**
 * The doPost method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to post.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

request.setCharacterEncoding(Constant.CHARACTERENCODING);
response.setContentType(Constant.CONTENTTYPE);
String sysdir = new SystemBean().getDir();
HttpSession session = request.getSession();
ComBean cb=new ComBean();
 String method = null;
 String date2=new SimpleDateFormat(“yyyy-MM-dd“).format(Calendar.getInstance().getTime());
 
 SmartUpload mySmartUpload = new SmartUpload();//init
 int count = 0;
 try{
 mySmartUpload.initialize(configrequestresponse);
             mySmartUpload.upload(); 
             method = mySmartUpload.getRequest().getParameter(“method“).trim();
            if(method.equals(“addStu“)){//增加学生
             String xm = mySmartUpload.getRequest().getParameter(“xm“);
             String xb = mySmartUpload.getRequest().getParameter(“xb“);
             String nl = my

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        709  2012-06-05 08:17  180JSP教师工作量统计系统\jsgzl\.classpath

     文件        288  2012-06-10 21:36  180JSP教师工作量统计系统\jsgzl\.mymetadata

     文件       1223  2012-06-02 06:33  180JSP教师工作量统计系统\jsgzl\.project

     文件       5889  2012-06-02 21:50  180JSP教师工作量统计系统\jsgzl\src\com\action\NewsServlet.java

     文件       7947  2012-06-04 20:44  180JSP教师工作量统计系统\jsgzl\src\com\bean\AdminBean.java

     文件        318  2012-06-07 21:20  180JSP教师工作量统计系统\jsgzl\src\com\util\CheckCode.java

     文件       1838  2012-06-09 15:28  180JSP教师工作量统计系统\jsgzl\src\com\util\Common.java

     文件        533  2012-06-06 01:26  180JSP教师工作量统计系统\jsgzl\src\com\util\Constant.java

     文件       2638  2012-06-02 01:05  180JSP教师工作量统计系统\jsgzl\src\com\util\DBO.java

     文件        650  2012-06-11 02:31  180JSP教师工作量统计系统\jsgzl\src\com\util\Filter.java

     文件        838  2012-06-11 00:31  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\default.jsp

     文件       1905  2012-06-06 07:59  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\foot.jsp

     文件       1227  2012-06-06 05:18  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\help.jsp

     文件        838  2012-06-01 15:16  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\index.jsp

     文件      13643  2012-06-10 03:03  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\left.jsp

     文件       1466  2012-06-03 23:38  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\main.jsp

     文件       5514  2012-06-07 09:40  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\iframe\top.jsp

     文件      10889  2012-06-04 20:23  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\admin_m.swf

     文件       6221  2012-06-02 20:33  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\Admin_style.css

     文件        876  2012-06-04 12:41  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\bg.jpg

     文件        315  2012-06-03 01:22  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\bt_login.gif

     文件        179  2012-06-01 11:36  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\bullet.gif

     文件      20734  2012-06-07 13:23  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\calendar.js

     文件      26508  2012-06-05 15:38  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\Common.js

     文件       3143  2012-06-10 03:30  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\date.js

     文件        835  2012-06-02 10:44  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\default.jsp

     文件        168  2012-06-04 01:29  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\HardWare.gif

     文件         85  2012-06-03 18:28  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\img_u.gif

     文件        835  2012-06-08 18:22  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\index.jsp

     文件         57  2012-06-10 11:46  180JSP教师工作量统计系统\jsgzl\WebRoot\admin\images\linkbg1.gif

............此处省略146个文件信息

评论

共有 条评论