728x90
16. pom.xml : jackson-core-asl, jackson-mapper-asl
(spring 4.x 버전에서는 다른거 사용!)
<!-- login 관련 -->
<!-- jackson-core-asl -->
<!-- 검색했을때 가장 위에나오는것 com.fasterxml.jackson.core » jackson-core이거는 스프링 4.x버전부터 나온것! 그아래것씀 -->
<!-- https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-core-asl -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- jackson-mapper-asl -->
<!-- 이거는 4점대 버전 com.fasterxml.jackson.core » jackson-databind -->
<!-- https://mvnrepository.com/artifact/org.codehaus.jackson/jackson-mapper-asl -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
17. WEB/INF/spring/sqls/test.sql (MYMEMBER)
DROP SEQUENCE MYNOMEMBERSEQ;
DROP TABLE MYNOMEMBER;
CREATE SEQUENCE MYNOMEMBERSEQ;
CREATE TABLE MYNOMEMBER(
MEMBERNO NUMBER PRIMARY KEY,
MEMBERID VARCHAR2(1000) NOT NULL,
MEMBERPW VARCHAR2(1000) NOT NULL,
MEMBERNAME VARCHAR2(1000) NOT NULL
);
INSERT INTO MYNOMEMBER
VALUES(MYNOMEMBERSEQ.NEXTVAL, 'admin', '1234', '관리자');
SELECT MEMBERNO, MEMBERID, MEMBERPW, MEMBERNAME
FROM MYNOMEMBER;
18. dto, dao, biz, controller
해당 파일들의 코드는 깃허브에서 참고해주세요!(링크 들어가면 바로 있습니다!)
19. src/main/resources/mybatis/mymember-mapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="mymember">
<select id="login" parameterType="myMemberDto" resultType="myMemberDto">
SELECT MEMBERNO, MEMBERID, MEMBERPW, MEMBERNAME
FROM MYNOMEMBER
WHERE MEMBERID = #{memberid}
AND MEMBERPW = #{memberpw}
</select>
<insert id="regist" parameterType="myMemberDto">
INSERT INTO MYNOMEMBER
VALUES(MYNOMEMBERSEQ.NEXTVAL, #{memberid}, #{memberpw}, #{membername})
</insert>
</mapper>
20. WEB-INF/spring/sqls/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd" >
<configuration>
<typeAliases>
<typeAlias type="com.mvc.upgrade.model.dto.MYBoardDto" alias="myBoardDto"/>
<typeAlias type="com.mvc.upgrade.model.dto.MYMemberDto" alias="myMemberDto"/>
</typeAliases>
<!-- resource : src/main/resources 와 같음 -->
<mappers>
<mapper resource="/mybatis/myboard-mapper.xml"/>
<mapper resource="/mybatis/mymember-mapper.xml"/>
</mappers>
</configuration>
views의 내용은 마찬가지로... 깃허브 참고해주세요!!
mymemberlogin.jsp파일과 mymemberregist.jsp파일 참고하시면 됩니다!
728x90
'Java 관련 > Spring Legecy' 카테고리의 다른 글
[Spring] transation(트랜잭션 - 원자성) (0) | 2022.04.07 |
---|---|
[Spring] Interceptor(인터셉터) (0) | 2022.04.06 |
[Spring] 스프링MVC - AOP (0) | 2022.04.04 |
[Spring] filter(javax.servlet.Filter) (0) | 2022.04.03 |
[Spring] 스프링으로 게시판만들기 (0) | 2022.04.02 |