본문 바로가기
국비교육

국비교육 74일차

by Diligejy 2019. 3. 22.

1.

// http://localhost:8787/TestWeb02/test/my01.do

@RequestMapping("/test/my01.do")

public String Prn02() {

return "string"; // 문자열도 jsp로 인식해버림 string.jsp


2.


ViewController02.java

// http:localhost:8787/TestWeb02/step/model.do

@RequestMapping("/step/model.do")

public String Method02(Map<String, String> model) throws Exception {

model.put("modelData", "step01 mode");

return "model";

}


model.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>

Model :

<%=request.getAttribute("modelData")%>

</body>

</html>


-> 왜 getAttribute를 쓸까? getValue가 아니고?


String 객체이기 때문에 Value로 넘길 수 없다.


3.

MVC구조에서

Biz로직을 부르는 건 Controller이다.


4.


'국비교육' 카테고리의 다른 글

국비교육 76일차  (0) 2019.03.26
국비교육 75일차  (0) 2019.03.25
국비교육 73일차  (0) 2019.03.21
국비교육 72일차  (0) 2019.03.20
국비교육 71일차  (0) 2019.03.19

댓글