|
@@ -1,40 +0,0 @@
|
|
-package com.it.servlet;
|
|
|
|
-
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import javax.servlet.ServletException;
|
|
|
|
-import javax.servlet.http.HttpServlet;
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-
|
|
|
|
-import com.it.bean.Discipline;
|
|
|
|
-import com.it.service.DisciplineService;
|
|
|
|
-import com.it.service.impl.DisciplineServiceImpl;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * Servlet implementation class DisciplineAddServlet
|
|
|
|
- */
|
|
|
|
-public class DisciplineAddServlet extends HttpServlet {
|
|
|
|
-
|
|
|
|
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
|
|
-
|
|
|
|
- request.setCharacterEncoding("UTF-8");
|
|
|
|
-
|
|
|
|
- try {
|
|
|
|
- String discipline_name = request.getParameter("discipline_name");
|
|
|
|
-
|
|
|
|
- Discipline discipline = new Discipline(discipline_name);
|
|
|
|
-
|
|
|
|
- DisciplineService disciplineService = new DisciplineServiceImpl();
|
|
|
|
- disciplineService.insert(discipline);
|
|
|
|
-
|
|
|
|
- request.getRequestDispatcher("DisciplineListServlet").forward(request, response);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
|
|
- doGet(request, response);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|