admin.category/CategoryModify.java
페이지 정보
작성자 관리자 작성일 23-03-19 10:55 조회 536 댓글 0본문
package admin.category;
import java.io.IOException;
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 dao.CategoryDAO;
import model.Category;
@WebServlet("/admin/category/modify")
public class CategoryModify extends HttpServlet {
private static final long serialVersionUID = 1L;
public CategoryModify() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
String number = request.getParameter("number");
String ca_id = request.getParameter("ca_id");
String ca_name = request.getParameter("ca_name");
String ca_use = request.getParameter("ca_use["+number+"]");
Category c = new Category();
c.setCa_id(ca_id);
c.setCa_name(ca_name);
c.setCa_use(ca_use);
CategoryDAO dao = new CategoryDAO();
dao.updateCategory(c);
response.sendRedirect("list");
}
}
댓글목록 0
등록된 댓글이 없습니다.