Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- php
- ciscopacket
- 리눅스
- 네트워크
- 정처기필기
- 버추얼머신
- cisco packet
- 이것이 자바다
- jsp연결
- javaee
- ospf
- jsp
- Oracle
- 데이터베이스
- 참조타입
- Java
- 오라클
- 원형그래프
- sql
- Cisco
- NCS
- 자바
- w3school
- rinux
- 정보처리기사
- VLAN
- html
- 라우터
- autoset
- 네트워크관리사
Archives
- Today
- Total
기록해! 정리해!
myBatis2 (4)- 자료실(사진) 본문
1. 폴더 생성
2. form_psd.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<h2> 성적 저장하기 </h2>
<form action="form_psd_ok.do" method="post"
enctype="multipart/form-data">
<table border=1 >
<tr> <td > 번호 </td><td > <input type=text name="sno" > </td> </tr>
<tr> <td> 사진 </td> <td > <input type=file name="file"></td> </tr>
<tr> <td colspan=2 align="center">
<input type=submit value="저장하기" >
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
3. ExamController
package com.rubypaper.controller;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import com.rubypaper.exam.ExamServiceImpl;
import com.rubypaper.exam.ExamVO;
@Controller
public class ExamController {
@Autowired // 중요 - 클래스를 사용해야 한다.
private ExamServiceImpl service;
@RequestMapping("/form.do")
String form(){
System.out.println("==> /form.do 확인");
return "form";
}
@RequestMapping("/formOk.do")
String formOk(ExamVO vo){
service.insert(vo);
return "redirect:getExamList.do";
}
@RequestMapping("/form_psd.do")
String form_psd(ExamVO vo){
System.out.println("==> /form_psd 확인");
return "form_psd";
}
@RequestMapping("/form_psd_ok.do")
String form_psd_ok(ExamVO vo){
System.out.println("==> /form_psd_ok 확인");
return "redirect:index.html";
}
@RequestMapping("/getExamList.do")
String getExamList(ExamVO vo , Model model ){
model.addAttribute("li", service.getExamList(vo));
return "getExamList";
}
@RequestMapping("/getExam.do")
String getExam(ExamVO vo , Model model ){
model.addAttribute("m", service.getExam(vo));
return "getExam";
}
}
4. index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<h2> 2022-10-13일 수업</h2>
<a href="form.do" > 저장하기 </a> <br><br>
<a href="getExamList.do" > 목록보기 </a> <br><br>
<a href="form_psd.do" > 자료실 저장 </a> <br><br>
</div>
</body>
</html>
'SpringBoot' 카테고리의 다른 글
myBatis2 (6)- 자료실(사진) (0) | 2022.10.13 |
---|---|
myBatis2 (5)- 자료실(사진) (0) | 2022.10.13 |
myBatis2 (3)- 검색창 (0) | 2022.10.13 |
myBatis2 (2)- 상세보기 (0) | 2022.10.13 |
myBatis2 (1) (0) | 2022.10.13 |
Comments