IT/Java Spring

ch08Mybatis - 03

Millennials 2020. 6. 19. 15:04

1) VO 생성

2) validation.properties

3) servlet-context.xml 설정

4) Controller 

5)insertForm.jsp 생성

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>회원등록</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/resources/css/style.css" type="text/css">
</head>
<body>
	<div class="page-main-style">
	<h2>회원 등록</h2>
	<form:form action="insert.do" commandName="memberVO">
		<ul>
			<li>
				<label for="id">아이디</label>
				<form:input path="id"/><form:errors path="id" cssClass="error-color"/>
			</li>
			<li>
				<label for="passwd">비밀번호</label>
				<form:input path="passwd"/><form:errors path="passwd" cssClass="error-color"/>
			</li>
			<li>
				<label for="name">이름</label>
				<form:input path="name"/><form:errors path="name" cssClass="error-color"/>
			</li>
		</ul>
		<div class="align-center">
			<input type="submit" value="등록">
			<input type="button" value="홈으로" onclick="location.href='list.do'">
		
		</div>
	</form:form>
	</div>
</body>
</html>

6)root-context.xml

7) MemberMapper.xml

MemberMapper.xml
0.00MB

8)MemberMapper.java 인터페이스 생성

9)MemberService.java 인터페이스 생성

MemberServiceImpl.java 클래스 작성

반응형

'IT > Java Spring' 카테고리의 다른 글

ch08Mybatis - 05 목록작업  (0) 2020.06.22
ch08Mybatis - 04  (0) 2020.06.22
ch08Mybatis - 02  (0) 2020.06.19
ch08Mybatis - 01  (0) 2020.06.19
Spring MVC 기본 게시판 예제 만들기 2부 어노테이션 - 0. 설정  (0) 2020.06.19