목록Web/Spring (12)
rose_brown

1. Calendar 사용한 요일 프로그램 YoilTeller.java package com.fastcampus.ch2; import java.util.Calendar; //년월일을 입력하면 요일을 알려주는 프로그램 public class YoilTeller { public static void main(String[] args) { // 1. 입력 String year = args[0]; String month = args[1]; String day = args[2]; int yyyy = Integer.parseInt(year); int mm = Integer.parseInt(month); int dd = Integer.parseInt(day); // 2. 작업 Calendar cal = Calenda..

원격 호출 package com.fastcampus.ch2; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller // 1. 원격 호출 가능한 프로그램으로 등록 public class Hello { // 2. URL과 메서드를 연결 @RequestMapping("/hello") public void main() { // 인스턴스 메서드 System.out.println("Hello"); } } 메모 @RequestMapping("/hello") - localhost:8080/ch2/hello를 접속한다 public void main() ..