JAVA/Spring 4.0
Spring4.0 이클립스 MVC 프로젝트생성 및 index.jsp로 매핑
왕왕왕왕
2015. 9. 16. 09:40
프로젝트 생성하면 이런 구조를 갖는데, WEB-INF디렉토리 하위에 위치한 home.jsp는
XML에 매핑에 영향을 받아서 매핑된 주소로 접근해야된다.
index.jsp는 WEB-INF디렉토리 상위에 위치하기 때문에, 현재 경로로 바로 접근가능하다.
index.jsp를 실행하면 home.jsp로 바로 넘어갈 수 있도록 구성했다.
index.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body onload="javascript:location.href='/king/view'">
//패키지명/매핑문자열을 써주면 첫페이지 거치면서 바로 매핑된페이지를 불러온다.
</body>
</html>