250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 27 | 28 | 29 | 30 |
Tags
- 토픽추출
- 파이썬
- r
- (깃)git bash
- 네이버뉴스
- tomoto
- 코사인 유사도
- test
- Topics
- spring MVC(모델2)방식
- RESFUL
- 지마켓
- mysql
- jsp 파일 설정
- db
- Python
- word2vec
- 크롤링
- oracle
- java
- 과학백과사전
- Gmarket
- lda
- pytorch
- 자바
- 방식으로 텍스트
- 幼稚园杀手(유치원킬러)
- 게시판 만들기
- Websocket
- 이력서
Archives
- Today
- Total
무회blog
spring MVC(모델2)방식,JAVA, MySQL , RESFUL, 게시판 만들기 , 001 (실행) 본문
실행 클래스-001
com.board
BoardApplication.java
package com.board;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jersey.JerseyProperties.Filter;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.web.filter.HiddenHttpMethodFilter;
@SpringBootApplication
@MapperScan(value = {"com.board.mapper"})
public class BoardApplication {
public static void main(String[] args) {
SpringApplication.run(BoardApplication.class, args);
}
/**
* SqlSessionFactory 설정
*/
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource)throws Exception{
SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
Resource[] res = new PathMatchingResourcePatternResolver().getResources("classpath:mappers/*Mapper.xml");
sessionFactory.setMapperLocations(res);
return sessionFactory.getObject();
}
/**
* HiddenHttpMethodFilter
*/
@Bean
public HiddenHttpMethodFilter hiddenHttpMethodFilter(){
HiddenHttpMethodFilter filter = new HiddenHttpMethodFilter();
return filter;
}
}
참고:
https://private.tistory.com/38?category=655784
'IT > Spring' 카테고리의 다른 글
spring MVC(모델2)방식,JAVA, MySQL , RESFUL, 게시판 만들기 , 003 (VO 셋팅), VO/DTO/domain (0) | 2020.08.24 |
---|---|
spring MVC(모델2)방식,JAVA, MySQL , RESFUL, 게시판 만들기 , 002.03 (컨트롤러) (0) | 2020.08.24 |
spring MVC(모델2)방식,JAVA, MySQL , RESFUL, 게시판 만들기 , 002.02 (컨트롤러) (0) | 2020.08.24 |
스프링 ,001-개발환경설정설명 (0) | 2020.07.21 |
SpringBoot 시작하기 (1) | 2020.04.20 |
Comments