- signin.jsp 파일 수정
<div class="container px-5">
<div class="row justify-content-center">
<a href="/joinInit">Sign up</a>
</div>
</div>
- MyWebInitController.java 파일 수정
@GetMapping("/joinInit")
public ModelAndView joinInit() {
logger.debug("request url : /joinInit");
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("join");
return modelAndView;
}
- /Tutorial/src/main/webapp/WEB-INF/join.jsp 생성
- /Tutorial/src/main/java/com/eun/tutorial/config/MyWebSecurityConfigurerAdapter.java 비인증에 /joinInit 추가
http
.authorizeRequests() // 접근에 대한 인증 설정
.antMatchers("/signinInit", "/assets/**", "/sign-in.css",
"/joinInit", "/join",
"/h2-console/**", "/error/**", "/favicon.ico", "/layout/test").permitAll() // 누구나 접근 허용
.anyRequest().authenticated();
1. mybatis-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>
<settings>
<setting name="jdbcTypeForNull" value="NULL" />
</settings>
</configuration>
2. mapper.xml 설정(jdbcType=VARCHAR)
<insert id="addUser" parameterType="com.eun.tutorial.dto.UserInfoDTO">
INSERT
INTO zthm_user (username, password, email, enable,
create_id, create_time, update_id, update_time)
VALUES (#{username},
#{password},
#{email, jdbcType=VARCHAR},
#{isEnable},
#{createId, jdbcType=VARCHAR},
to_char(sysdate,'yyyymmddhh24mmss'),
#{updateId, jdbcType=VARCHAR},
to_char(sysdate,'yyyymmddhh24mmss'))
</insert>
isEnable(DTO) -> enable(DB)