commit
7158dd0bef
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -1,23 +1,29 @@
|
||||
package servlet;
|
||||
|
||||
import core.user.User;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
@WebServlet("/student-fill-graduation-design-information")
|
||||
public class S_StudentFillGraduationDesignInformation extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
super.doPost(request, response);
|
||||
String content1=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8");
|
||||
String content2=request.getParameter("score");
|
||||
try {
|
||||
|
||||
String id = request.getParameter("id");
|
||||
Map<String,String> vMap = servlet.Utils.getVMap(vName,request);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
static String[] vName = {
|
||||
"chinese_name",
|
||||
"english_name",
|
||||
"type_of_topic",
|
||||
"source_of_design",
|
||||
"nature_of_design",
|
||||
"description_of_topic"
|
||||
};
|
||||
}
|
||||
|
@ -1,19 +1,17 @@
|
||||
package servlet;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.MultipartConfig;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@WebServlet(name = "S_StudentUploadFinishedProduct")
|
||||
@WebServlet(name = "student-upload-finished-product")
|
||||
@MultipartConfig
|
||||
public class S_StudentUploadFinishedProduct extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,18 @@
|
||||
package servlet;
|
||||
|
||||
import org.apache.coyote.Request;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface Utils {
|
||||
static Map<String,String> getVMap(String[] vName, HttpServletRequest request){
|
||||
Map<String,String> vMap = new HashMap<>();
|
||||
for(int i=0;i<vName.length;i++){
|
||||
vMap.put(vName[i],request.getParameter(vName[i]));
|
||||
}
|
||||
return vMap;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue