<%@page import="imageboard.dto.ImageboardDTO"%> <%@page import="com.oreilly.servlet.MultipartRequest"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String realFolder = request.getServletContext().getRealPath("/storage"); MultipartRequest mr = new MultipartRequest(request, realFolder, 1024*1024*5, "utf-8"); String imageId = mr.getParameter("imageId"); String imageName = mr.getParameter("imageName"); int imagePrice = Integer.parseInt(mr.getParameter("imagePrice")); int imageQty = Integer.parseInt(mr.getParameter("imageQty")); String imageContent = mr.getParameter("imageContent"); String imageFile = mr.getOriginalFileName("imageFile"); // filesystemname ImageboardDTO dto = new ImageboardDTO(); dto.setImageId(imageId); dto.setImageName(imageName); dto.setImagePrice(imagePrice); dto.setImageQty(imageQty); dto.setImageContent(imageContent); dto.setImageFile(imageFile); ImageboardDAO dao = ne"> <%@page import="imageboard.dto.ImageboardDTO"%> <%@page import="com.oreilly.servlet.MultipartRequest"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String realFolder = request.getServletContext().getRealPath("/storage"); MultipartRequest mr = new MultipartRequest(request, realFolder, 1024*1024*5, "utf-8"); String imageId = mr.getParameter("imageId"); String imageName = mr.getParameter("imageName"); int imagePrice = Integer.parseInt(mr.getParameter("imagePrice")); int imageQty = Integer.parseInt(mr.getParameter("imageQty")); String imageContent = mr.getParameter("imageContent"); String imageFile = mr.getOriginalFileName("imageFile"); // filesystemname ImageboardDTO dto = new ImageboardDTO(); dto.setImageId(imageId); dto.setImageName(imageName); dto.setImagePrice(imagePrice); dto.setImageQty(imageQty); dto.setImageContent(imageContent); dto.setImageFile(imageFile); ImageboardDAO dao = ne"> <%@page import="imageboard.dto.ImageboardDTO"%> <%@page import="com.oreilly.servlet.MultipartRequest"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String realFolder = request.getServletContext().getRealPath("/storage"); MultipartRequest mr = new MultipartRequest(request, realFolder, 1024*1024*5, "utf-8"); String imageId = mr.getParameter("imageId"); String imageName = mr.getParameter("imageName"); int imagePrice = Integer.parseInt(mr.getParameter("imagePrice")); int imageQty = Integer.parseInt(mr.getParameter("imageQty")); String imageContent = mr.getParameter("imageContent"); String imageFile = mr.getOriginalFileName("imageFile"); // filesystemname ImageboardDTO dto = new ImageboardDTO(); dto.setImageId(imageId); dto.setImageName(imageName); dto.setImagePrice(imagePrice); dto.setImageQty(imageQty); dto.setImageContent(imageContent); dto.setImageFile(imageFile); ImageboardDAO dao = ne">
<%@page import="imageboard.dao.ImageboardDAO"%>
<%@page import="imageboard.dto.ImageboardDTO"%>
<%@page import="com.oreilly.servlet.MultipartRequest"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String realFolder = request.getServletContext().getRealPath("/storage");
MultipartRequest mr = new MultipartRequest(request, realFolder, 1024*1024*5, "utf-8");

String imageId = mr.getParameter("imageId");
String imageName = mr.getParameter("imageName");
int imagePrice = Integer.parseInt(mr.getParameter("imagePrice"));
int imageQty = Integer.parseInt(mr.getParameter("imageQty"));
String imageContent = mr.getParameter("imageContent");

String imageFile = mr.getOriginalFileName("imageFile"); // filesystemname

ImageboardDTO dto = new ImageboardDTO();
dto.setImageId(imageId);
dto.setImageName(imageName);
dto.setImagePrice(imagePrice);
dto.setImageQty(imageQty);
dto.setImageContent(imageContent);
dto.setImageFile(imageFile);

ImageboardDAO dao = new ImageboardDAO();
int res = dao.imageboardWrite(dto);

request.setAttribute("res", res);
request.setAttribute("imageName", imageName);

RequestDispatcher dispatcher = request.getRequestDispatcher("../main/index.jsp?req=imageboardWriteResult");
dispatcher.forward(request, response);
%>