资源简介

一个基于SSM框架实现的教学大纲管理系统,除了大纲的增删改查,还加上了上传下载等其它功能,适合学习框架或是直接用这个系统完成作业。

资源截图

代码片段和文件信息

package com.three.controller;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.UUID;

import javax.annotation.Resource;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.validation.Valid;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.i18n.CookieLocaleResolver;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;

import com.three.po.Teach;
import com.three.service.TeachService;
import com.three.service.impl.TeachServiceImpl;


@Controller
public class TeachController {
@Autowired
private  TeachService teachService;
//private TeachServiceImpl teachServiceImpl;
/*public void setTeachService(TeachService teachService) {
this.teachService=teachService;
}*/
@RequestMapping(“/toIndex“)
public String toIndex( ) {
    return “index“;
}
@RequestMapping(“/addMessage“)
public String addMessage(@Valid @ModelAttribute(“teach“)Teach teachBindingResult BrHttpServletRequest requestHttpServletResponse response) throws Exception{
try {
String name=request.getParameter(“outlineName“);
System.out.println(name);
System.out.println(teach.getOutlineName());
if(Br.hasErrors()) {
//System.out.println(Br.rejectValue());
//request.setAttribute(“error“ “nice“);
request.setAttribute(“flag“ “fail!“);
return “index“;
//request.getRequestDispatcher(“/toIndex“).forward(request response);
}
String content=teach.getOutlineDetail();
FileWriter f1=new FileWriter(“D:“+File.separator+“SSM上传下载“+File.separator+teach.getOutlineName()+“.html“true);
f1.write(content+“\r\n“+“
“);
f1.close();
teach.setOutlineDetail(“D:“+File.separator+“SSM上传下载“+File.separator+teach.getOutlineName()+“.html“);
System.o

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         782  2018-05-15 17:11  Task3_SSM\.classpath
     文件         909  2018-04-20 15:20  Task3_SSM\.project
     文件         567  2018-04-12 19:41  Task3_SSM\.settings\.jsdtscope
     文件         364  2018-04-12 19:41  Task3_SSM\.settings\org.eclipse.jdt.core.prefs
     文件         566  2018-05-15 17:11  Task3_SSM\.settings\org.eclipse.wst.common.component
     文件         305  2018-04-12 19:41  Task3_SSM\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-04-12 19:41  Task3_SSM\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-04-12 19:41  Task3_SSM\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          39  2018-04-12 19:41  Task3_SSM\WebContent\meta-INF\MANIFEST.MF
     文件         804  2018-05-06 16:56  Task3_SSM\WebContent\WEB-INF\jsp\error.jsp
     文件       10493  2018-05-15 19:05  Task3_SSM\WebContent\WEB-INF\jsp\index.jsp
     文件        4857  2018-06-02 16:07  Task3_SSM\WebContent\WEB-INF\jsp\teach_list.jsp
     文件     2029794  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\ant-1.9.6.jar
     文件       18392  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\ant-launcher-1.9.6.jar
     文件       53468  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\asm-5.1.jar
     文件     1929029  2017-03-28 13:54  Task3_SSM\WebContent\WEB-INF\lib\aspectjweaver-1.8.10.jar
     文件      299725  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\cglib-3.2.4.jar
     文件       65100  2018-03-27 09:03  Task3_SSM\WebContent\WEB-INF\lib\classmate-1.3.4.jar
     文件      174167  2017-03-30 10:23  Task3_SSM\WebContent\WEB-INF\lib\commons-dbcp2-2.1.1.jar
     文件       69002  2017-06-04 20:27  Task3_SSM\WebContent\WEB-INF\lib\commons-fileupload-1.3.1.jar
     文件      185140  2017-06-04 20:29  Task3_SSM\WebContent\WEB-INF\lib\commons-io-2.4.jar
     文件       61829  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\commons-logging-1.2.jar
     文件      111969  2017-03-30 10:23  Task3_SSM\WebContent\WEB-INF\lib\commons-pool2-2.4.2.jar
     文件     1130724  2018-03-27 09:03  Task3_SSM\WebContent\WEB-INF\lib\hibernate-validator-6.0.9.Final.jar
     文件      135814  2018-03-27 09:04  Task3_SSM\WebContent\WEB-INF\lib\hibernate-validator-annotation-processor-6.0.9.Final.jar
     文件       37628  2018-03-27 09:03  Task3_SSM\WebContent\WEB-INF\lib\hibernate-validator-cdi-6.0.9.Final.jar
     文件      734815  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\javassist-3.21.0-GA.jar
     文件      237795  2018-03-27 09:03  Task3_SSM\WebContent\WEB-INF\lib\javax.el-3.0.1-b09.jar
     文件       66469  2018-03-27 09:03  Task3_SSM\WebContent\WEB-INF\lib\jboss-logging-3.3.2.Final.jar
     文件       20962  2002-07-27 18:15  Task3_SSM\WebContent\WEB-INF\lib\jstl.jar
     文件      489884  2017-03-06 11:05  Task3_SSM\WebContent\WEB-INF\lib\log4j-1.2.17.jar
............此处省略52个文件信息

评论

共有 条评论