스프링 웹 개발 하기
-
02.세션을 이용한 로그인.스프링 웹 개발 하기/로그인 처리 2020. 2. 9. 17:21
보기전에 스프링 구조(2)를 참조. Session은 서버에 어떤 값의 정보를 저장해서 해당 정보를 사용하는 방법입니다.(로그인 같은 경우 사용자 정보.) 그렇기 때문에 브라우저를 닫으면 세션이 끊겨서 해당 정보가 지워지게 됩니다. 1.Mapper 만들기 1 2 3 4 5 6 7 8 9 10 11 select * from tbl_member where key = #{key} and pw = #{pw} and interlock_type = 'main' 2.TEST 쿼리 1 2 3 4 insert into tbl_member (key,pw,name,email,nickname,auth,interlock_type,regdate) values ('admin','1234','전승우','aa@naver.com','wo..
-
01. 로그인 만들기(DB 만들기)스프링 웹 개발 하기/로그인 처리 2020. 2. 9. 16:56
1.테이블 만들기 쿼리는 postgresql 입니다. 하지만 다른 쿼리도 크게 다르지 않으니 사용하시는 데에는 크게 문제가 없을 거 같아요. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 -- 테이블 생성 create table tbl_member( key varchar(80), nickname varchar(50) PRIMARY KEY, pw varchar(100), name varchar(80) not null, email varchar(200) not null, phoneNumber int, birthday int, gender varchar(3), auth int not null, sessionkey varchar(50)..
-
0.스프링 구조 설명.스프링 웹 개발 하기/스프링 개발 초기 설정. 2020. 1. 27. 16:31
실제 프로젝트에 사용할 JAVA 1.8,Tomcat 7 ,DB PostgresSql(설정은 오라클 Mysql 포함.) 1. 스프링 구조. 스프링 구조는 기본적으로 MVC 디자인 패턴 구조로 되어 있다. (M)odel(객체) (V)iew(화면) (C)ontroller(조작) 으로 나누는 방식이다. 하지만 같은 MVC 지만 다양한 방식으로 구조를 잡기 때문에 어떤 분은 controller 대신 servlet ,VO 대신 Bean으로 잡으시는 분 들고 있고 다양하다. 그러기 때문에 이건 제가 자주쓰는 구조일 뿐 자기한태 맞는 구조를 찾는 것도 좋은 방식으로 생각하고 있습니다. .jsp 는 화면에 보여주는 역할을 한다. .xml 은 주로 설정 관련된 역할을 한다. .java 는 데이터를 가공하고 DB와 연결을 ..
-
6. 마이바티스 연결.스프링 웹 개발 하기/스프링 개발 초기 설정. 2020. 1. 5. 21:28
마이바티스 공식 홈페이지. MyBatis – 마이바티스 3 | 시작하기 이제부터 다룰 스코프와 생명주기에 대해서 이해하는 것은 매우 중요하다. 스코프와 생명주기를 잘못 사용하는 것은 다양한 동시성 문제를 야기할 수 있다. 의존성 삽입 프레임워크는 쓰레드에 안전하도록 해준다. 트랜잭션 성질을 가지는 SqlSessions과 매퍼들 그리고 그것들을 직접 빈에 삽입하면 생명주기에 대해 기억하지 않아도 되게 해준다. DI프레임워크와 마이바티스를 사용하기 위해 좀더 많은 정보를 보기 위해서는 MyBatis-Spring이나 MyBatis mybatis.org 1. POM.xml 1 2 3 4 5 6 7 8 9 10 11 org.mybatis mybatis 3.4.1 org.mybatis mybatis-spring 1..
-
4.DB설정. -- postgresql,mysql,oracle스프링 웹 개발 하기/스프링 개발 초기 설정. 2020. 1. 5. 18:01
DB는 입맛에 따라 사용하시면 됩니다. 1.POM.xml 1 2 3 4 5 6 7 8 9 10 11 12 13 org.springframework spring-test ${org.springframework-version} org.springframework spring-jdbc ${org.springframework-version} 1)DB 설정. ●PostgreSQL 설정. 1 2 3 4 5 6 7 postgresql postgresql 9.0-801.jdbc4 ●orcle 설정.(오라클 repositories 도 설정 해야 한다.) 1 2 3 4 5 6 7 oracle http://maven.jahia.org/maven2 1 2 3 4 5 6 com.oracle ojdbc6 12.1.0.2 repo..
-
3.스프링 기본 설정.스프링 웹 개발 하기/스프링 개발 초기 설정. 2020. 1. 1. 21:56
1.자바 버전 설정. 1) 마우스 우클릭 후 Project Facets에 들어간다. 2) java Bulid Path에 들어간다. javaSE 1.8이 맞는지 확인한다. 틀릴 경우 edit를 눌러서 나와 맞는 jre를 등록 시켜준다. ●Add JARs.. : 프로젝트 밑의 jar파일을 등록시켜준다. ●Add Extenal JARs.. : 내 PC의 jar 파일을 등록 시켜준다. (이렇게 했을 시 다른 곳에서 프로젝트 할 때 같은 위치에 jar파일을 등록 해야 하기 때문에 잘 사용하지 않는다.) 2. 언어 환경 설정. 설정 이유 : 이걸 설정 할 경우 나중에 jsp html 등 만들때 encoding type이 고정적으로 UTF-8로 나오게 하기 위해서다.(안그럼 만들때마다 일일이 바꿔줘야 해서 귀찮다.)..