[Spring 연습] 요일 출력기 및 기타 작업

2024. 7. 20. 22:00WebBack/Spring 연습

1. 클래스 YoilTeller

요구: @Controller @RequestMapping 사용 

입력 예시: localhost/app/yoil?year=2024&month=7&day=16

출력 예시: 2024년 7월 16일은 화요일입니다.

https://github.com/ycraah/Spring/blob/main/YoilTeller.java

 

Spring/YoilTeller.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

2. 클래스 YoilTeller

요구: MVC에 따라 입력/작업(클래스 분리)/출력 분리(모델) / 유효성 검사

입력 예시: localhost/app/yoil?year=2024&month=7&day=16 --> 페이지

입력 예시2: localhost/app/yoil?year=2024&month=15&day=50 --> 에러 페이지

출력 예시: 2024년 7월 16일은 화요일입니다.

https://github.com/ycraah/Spring/blob/main/YoilTeller.java

 

Spring/YoilTeller.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

3. 클래스 TwoDiceServlet

요구: @WebServlet 사용, 서블렛으로 HTML 작성

입력 예시: localhost/app/diceServlet

https://github.com/ycraah/Spring/blob/main/TwoDiceServlet.java

 

Spring/TwoDiceServlet.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

4. 클래스 YoilTellerRequired

요구: @RequestParam 사용, 디폴트값 입력

입력예시: localhost/app/yoilRequired

출력 예시: 2024년 1월 1일은 화요일입니다.

https://github.com/ycraah/Spring/blob/main/YoilTellerRequired.java

 

Spring/YoilTellerRequired.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

5. 클래스 YoilTellerCatcher

요구: 예외 처리하기, 필수값 입력 요구

입력예시: localhost/app/yoilCatcher

출력 예시: 입력값이 잘못되었습니다.

https://github.com/ycraah/Spring/blob/main/YoilTellerCatcher.java

 

Spring/YoilTellerCatcher.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

6.클래스 YoilTellerDate

요구: 입력을 객MyDate로 받아 저장

입력예시: localhost/app/ yoilRequired ?year=2024&month=7&day=15

출력 예시: 2024년 7월 16일은 화요일입니다.

https://github.com/ycraah/Spring/blob/main/YoilTellerDate.java

 

Spring/YoilTellerDate.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

7.클래스 YoilTellerModelAtt

요구: @ModelAttribute로 model로 따로 저장하지 않고 저장

입력예시: localhost/app/ yoilRequired ?year=2024&month=7&day=15

출력 예시: 2024년 7월 16일은 화요일입니다.

https://github.com/ycraah/Spring/blob/main/YoilTellerModelAtt.java

 

Spring/YoilTellerModelAtt.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

*클래스 TwoDice

사용: resources 폴더 이용하기

입력 예시: localhost/app/dice

https://github.com/ycraah/Spring/blob/main/TwoDice.java

 

Spring/TwoDice.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

*JSP 파일 TwoDice.jsp

실행: jsp 파일로 HTML 작성

입력 예시: localhost/app/TwoDice.jsp

https://github.com/ycraah/Spring/blob/main/TwoDice.jsp

 

Spring/TwoDice.jsp at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

* JSTL 파일 jstlTest.jsp

실행: jstl로 html작성

입력예시: localhost/app/jstl.jsp

출력예시:

1 2 3 4 5 6 7 8 9 10

1.arr[0]=10
2.arr[1]=20
3.arr[2]=30
4.arr[3]=40
5.arr[4]=50
6.arr[5]=60
7.arr[6]=70
msg=abc

msg=< h1 >abc</ h1 >
성인입니다.

https://github.com/ycraah/Spring/blob/main/TwoDice.jsp

 

Spring/TwoDice.jsp at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

*클래스 PerformanceFilter

사용: @WebFilter / int / service / destroy

입력예시: localhost/app/*

출력예시: [/app/]소요시간 = 85ms

https://github.com/ycraah/Spring/blob/main/PerformanceFilter.java

 

Spring/PerformanceFilter.java at main · ycraah/Spring

Contribute to ycraah/Spring development by creating an account on GitHub.

github.com

 

'WebBack > Spring 연습' 카테고리의 다른 글

[TodoList] 와이어 프레임  (0) 2024.07.22
[Spring] 회원가입 폼 작성  (0) 2024.07.21