GitHub

https://github.com/Backcoder-June

BackCoder 기록 그리고 숙달

Back to the eGovFrame

[ eGov ] 전자정부 프레임워크 환경 설정, xml 설정

Backcoder 2022. 12. 31. 23:06

전자정부 프레임워크의 기반은 Spring 이고,
IDE 는 eclipse 를 기반으로 하고있어서 초기 설정과정은 비슷한 부분이 많습니다.
초기 기초적인 설정순서와 xml 기본 설정, Spring 과의 차이점을 정리해보았습니다.

1. 설치
https://www.egovframe.go.kr/home/main.do

 

표준프레임워크 포털 eGovFrame

본문 내용 바로가기 대메뉴 바로가기 소개 구성 구성상세 버전별 구성 오픈소스 SW 현황 아키텍쳐 라이선스 적용사례 추진성과 기술지원내역 컨트리뷰션 센터소개 지원서비스 적용지원 서비스

www.egovframe.go.kr

공식 사이트의 실행환경 / 개발환경 / 운영환경 등의 다운로드 목록 중, IDE 설치는 개발환경 에서 가능합니다.


4.X 대 버전은 아직은 많이 사용되지 않는 듯 합니다.
2021년 release 된 3.10 버전을 설치해주었습니다. ( Window => 64bit / Mac - mac / Linux - linux )


2. 환경설정

(1) perspective에서 egovFrame 선택

Spring에서 Spring Legacy Project => Spring MVC 로 생성하던 프로젝트가
egov 에서  eGovFrame Web Project 에 해당한다고 보면 될 것 같습니다.

=> 위의 perspective 설정에서 javaEE 가 아닌 egovFrame 을 선택해야 해당 프로젝트 종류로 생성이 가능합니다.

- 콘솔 창 쪽에 사용하지 않는 view 들은 닫고, window - show view 에서 console / server 정도를 띄워둡니다.


(2) UTF-8 설정

  • window - preference - general - workspace UTF-8 ( 자바파일 인코딩 )
  • Web - CSS / HTML / JSP UTF-8

(3) Tomcat 서버 설정

  • window - preference - server - Runtime Environments

=> Add => 톰캣버전 => browse => 설치된 Tomcat 폴더 선택 ( 미리 설치가 되어있어야 합니다. )

  • 콘솔 쪽 Server - create new server - tomcat 버전 선택 => 현재 프로젝트 Add
  • 생성된 톰캣 open => 포트 번호 지정 / timeout 지정

(4) JSP 설정

  • View-Resolver경로 설정 ( JSP )

=> [dispatcher-servlet.xml]
webapp - WEB-INF - config - egocframework - springmvc - dispatcher-servlet.xml => prefix / suffix

  • JSP 템플릿

=> window - preference - jsp - editor - template
( 최초에 해당 template 선택해두면 자동 template 적용 )

  • Jquery 적용 ( 기본 제공 X )

=> mavenrepository => org.webjars => pom.xml 적용

스크립트 추가

<script src="/egovproject/webjars/jquery/3.6.0/jquery.min.js"></script>

=> depencency 에서 resources 아래 경로 확인해서 적용 ( 기본 프로젝트명 경로로 시작 )


(5) XML 설정
: resources - egovframework - spring 디렉에 기본설정 xml들 모아두었다. (1 - 5 )


<기본 설정들>

(1) context-mapper.xml
=> @MapperScan 설정 Mapper 베이스패키지 지정
=> Mybatis config XML 지정

=> Mybatis SQL mapper 파일들 xml *. 로 묶어서 지정


(2) context-sqlMap.xml

=> IBATIS 일 때, config XML 지정


(3) context-datasource.xml

=> DB 연결 / DB 정보


(4) context-common.xml
=> @ComponentScan => basepackage 설정


(5) context-aspect.xml


=> AOP config / ExceptionHandler 설정


[ Mybatis xml 설정 ]
(6) SQL.xml => mapper 별 SQL.xml
(7) sql-mapper-config.xml => Alias 설정
(8) sql-map-config.xml => Ibatis 일 때 설정


(9) dispatcher-servlet.xml
( WEB-INF - config - egoframework - springmvc )

=> @ComponentScan 설정 : Annotation 사용 설정 ( @Controller @Service @Repository )
=> ViewResolver 설정 ( JSP prefix / suffix )

(10) web.xml ( src - web.xml )
=> filter / filter-mapping 설정 ( UTF-8 인코딩 / .do )
=> 설정을 읽어올 xml 파일들 지정 ( context-*.xml, dispatcher-servlet.xml )
=> servlet-mapping ( .do URL 설정 )
=> error page 설정

(11) pom.xml
=> 프로젝트 전반 관리
=> repository 설정
=> dependency 라이브러리들 설정
=> plugin 설정

 

(12) [Tomcat] web.xml

=> servlet / servlet mapping - JSP 설정 

=> session-timeout 설정 ( 30min default )

 

(13) [Tomcat] server.xml

=> Server port번호 설정

=> connectionTimeout 설정 / redirectPort 설정 

=> Host appBase설정 ( "webapps" )

 

(14) [Tomcat] context.xml 

=> app에서 읽어올 web.xml / tomcat-web.xml 설정 (WatchedResource) 

'Back to the eGovFrame' 카테고리의 다른 글

[ eGovFrame ] Jackson 설정  (0) 2023.01.11
[ eGov ] Mysql 연동, Mybatis 설정  (0) 2022.12.31
[ eGovFrame ] 전자정부 프레임워크  (0) 2022.12.29