본문 바로가기
프로그램/JPA

전자정부 eGovFramework jpa + 마이바티스 환경셋팅

by cbwstar 2021. 6. 30.
728x90
반응형

전자정부 3.9.0 최신버전 jpa + 마이바티스 환경셋팅 정리

egov 시큐리티 적용 

실업무에 적용해서 운영하고 있는 환경 설정 입니다.

전자정부 환경 셋팅에 어려움이 있으신 분이 있으면 참조 하시기 바랍니다.

마이바티스만 사용하다가 JPA와 마이바티스 같이 한번 사용해 볼려고 셋팅하였습니다.

엔티티,DTO,mapper,repository,controller,servce 전자정부 mvc 패턴 귀찮아서 자동으로 소스까지 생성하는 기능도 vue를 이용하여 만들었습니다. 개발자의 편의를 위해서 공통으로 조회하고 등록하는 기능을 그냥 조건을 주면 자동으로 만들어 주는 자동화 툴을 적용하였습니다.

 

시간 날때 마다 하나씩 올려 볼까 합니다.

일단 전자정부 기본환경 설정 파일입니다.

전자정부 3.9.0 버전으로 진행하였습니다.

 

db는 2개를 사용하는 관계로 티베로와 postgresql 멀티 db 접속하게 설정하였습니다.

 

global.properties 파일 환경설정

#사용시스템 구분
Globals.System = DEV
    
       
Globals.OsType = UNIX
Globals.DbType = postgresql
#Globals.DbType = tibero
 
# dummy,session,security 
Globals.Auth = session
         

#tibero
Globals.tibero.DriverClassName=com.tmax.tibero.jdbc.TbDriver
Globals.tibero.Url=jdbc:tibero:thin:@192.168.1.18:9027:test
Globals.tibero.UserName = tibero
Globals.tibero.Password = tibero
 

#postgresql 계정
Globals.postgresql.DriverClassName=org.postgresql.Driver
Globals.postgresql.Url=jdbc:postgresql://localhost:5432/testdb
Globals.postgresql.UserName = test
Globals.postgresql.Password = test


#login web
Globals.web.loginUrl = /grain/mbr/Login.do
Globals.web.loginSuccessUrl = /grain/main/loginSuccess.do
Globals.web.accessDeniedUrl = /grain/mbr/accessDenied.do
Globals.web.autoLogOutUrl = /grain/mbr/autoLogOutInfo.do
Globals.web.concurrentExpiredUrl = /common/expiredError.jsp


# (사용여부 설정값 : true, false)
Globals.login.Lock = true
# -인증 제시도 횟수
Globals.login.LockCount = 5


# 환경파일 위치
Globals.ShellFilePath     = globals.properties
Globals.ServerConfPath    = conf/server.properties
Globals.ClientConfPath    = conf/client.properties
Globals.FileFormatPath    = conf/format.properties
Globals.GPKIConfPath      = conf/gpki.properties
Globals.ConfPath          = conf
Globals.MailRequestPath   = mail/request/
Globals.MailRResponsePath = mail/response/
Globals.SMEConfigPath     = conf/SMEConfig.properties

#패키지 생성 경로지정
Globals.classPath =  c:/eGovFrameDev-3.9.0-64bit_new/workspace/invako/src/main/java/

# 파일업로드 경로(경로 설정은 반드시 절대경로를 사용해야함,경로 뒤에/를 붙여 주어야함.
Globals.fileStorePath =  c:/eGovFrameDev-3.9.0-64bit/upload/
Globals.fileStorePath2 = /was/GGM/upload/

#파일경로(운영)
#Globals.fileStorePath = /naqs/test/upload/

# 업로드 url 경로 암호화 KEY
#Globals.filePath.Encryption.key = 10자리이상,알파벳 및 숫자 및 특수기호 혼용하여 키를 지정한다. 

# 파일확장자,화이트리스트(허용목록) : 파일확장자를(.)과 함께 연이어서 사용함. 다운로드는 확장자 없이 저장하는관계로 사용안함
Globals.fileUpload.Extensions = .jpg.jpeg.gif.png.bmp.txt.zip.7z.gzip.doc.docx.ppt.pptx.xls.xlsx.pdf.hwp
#Globals.fileDownload.Extensions = .jpg.jpeg.gif.png.bmp.txt.zip.7z.gzip.doc.docx.ppt.pptx.xls.xlsx.pdf.hwp


# 보고서 경로
test.reportserver.url = 192.168.1.30
test.dataserver.url = 192.168.1.30
test.mrd.path = /ReportingServer/mrd


# 외부아이피 접속 차단
# (사용여부 설정값 : true, false)
Globals.ip.lock = false
Globals.ip.cutoff = ROLE_ADMIN,ROLE_USER
# 외부아이피 접속허용 아이피
Globals.ip.allow = 200.120.105.170
  
 
# 사용자전환 허용 아이피
Globals.user.ipAllow = 127.0.0.1
 

spring -> com -> 환경설정 파일 셋팅

1. context-aspect.xml (에러가 났을때 Exception 처리 설정)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd">

	<aop:config>  
        <aop:pointcut id="egov.serviceMethod" expression="execution(* egovframework.invako..service.*Service.*(..)) || execution(* egovframework.com..service.*Service.*(..))" />
         
        <aop:aspect ref="egov.exceptionTransfer">
			<aop:after-throwing throwing="exception" pointcut-ref="egov.serviceMethod" method="transfer" />
		</aop:aspect>
	</aop:config>
	
	<bean id="egov.exceptionTransfer" class="egovframework.rte.fdl.cmmn.aspect.ExceptionTransfer">
		<property name="exceptionHandlerService">
			<list>
				<ref bean="defaultExceptionHandleManager" />
				<ref bean="otherExceptionHandleManager" />
			</list>
		</property>
	</bean> 
	
	
	<bean id="defaultExceptionHandleManager" class="egovframework.rte.fdl.cmmn.exception.manager.DefaultExceptionHandleManager">
		<property name="reqExpMatcher">
			<ref bean="egov.antPathMater"/>
		</property>
		<property name="patterns">
			<list>
				<value>**service.*</value>
			</list>
		</property>
		<property name="handlers">
			<list>
				<ref bean="egovHandler" />
			</list>
		</property>
	</bean>
	
	<bean id="otherExceptionHandleManager" class="egovframework.rte.fdl.cmmn.exception.manager.DefaultExceptionHandleManager">
		<property name="reqExpMatcher">
			<ref bean="egov.antPathMater"/>
		</property>
		<property name="patterns">
			<list>
				<value>**service.*</value>
			</list>
		</property>
		<property name="handlers">
			<list>
				<ref bean="otherHandler" />
			</list>
		</property>
	</bean>
	
	<bean id="egovHandler" class="egovframework.com.cmm.EgovComExcepHndlr" />
	<bean id="otherHandler" class="egovframework.com.cmm.EgovComOthersExcepHndlr" />	
	
</beans>

2. context-common.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
 
    <context:component-scan base-package="egovframework">
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/>
		<context:include-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>

    <context:annotation-config/>
    
    <!-- 국제화 Message 설정 -->
	<bean id="messageSource" class="egovframework.com.cmm.util.EgovWildcardReloadableResourceBundleMessageSource">
		<property name="egovBasenames">
			<list>
				<value>classpath*:egovframework/message/com/**/*</value>
				<value>classpath:/egovframework/rte/fdl/idgnr/messages/idgnr</value>
				<value>classpath:/egovframework/rte/fdl/property/messages/properties</value>
				<value>classpath:/egovframework/egovProps/globals</value>
				<!-- wildfly 와일드카드 경로를 제대로 인식못하는지 못가져와서 에러가 난다. 확인된 모든 경로를 추가해준다 -->
				<value>classpath:/egovframework/message/com/message-common</value>
			</list>
		</property>
		 
		<property name="cacheSeconds">
			<value>60</value>
		</property>
	</bean>
	
	<bean id="egovMessageSource" class="egovframework.com.cmm.EgovMessageSource">
        <property name="reloadableResourceBundleMessageSource">
            <ref bean="messageSource" />
        </property>
    </bean>
    
	<!-- 실행환경에서 빈 이름 참조(AbstractServiceImpl) -->
	<bean id="leaveaTrace" class="egovframework.rte.fdl.cmmn.trace.LeaveaTrace">
		<property name="traceHandlerServices">
			<list>
				<ref bean="egov.traceHandlerService" />
			</list>
		</property>
	</bean>
	
	<bean id="egov.traceHandlerService" class="egovframework.rte.fdl.cmmn.trace.manager.DefaultTraceHandleManager">
		<property name="reqExpMatcher">
			<ref bean="egov.antPathMater" />
		</property>
		<property name="patterns">
			<list>
				<value>*</value>
			</list>
		</property>
		<property name="handlers">
			<list>
				<ref bean="egov.defaultTraceHandler" />
			</list>
		</property>
	</bean>

	<bean id="egov.antPathMater" class="org.springframework.util.AntPathMatcher" />
	<bean id="egov.defaultTraceHandler" class="egovframework.rte.fdl.cmmn.trace.handler.DefaultTraceHandler" />
	
	<!-- MULTIPART RESOLVERS -->
    <!-- regular spring resolver -->
    <!-- 
    <bean id="spring.RegularCommonsMultipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize" value="600000000" />
        <property name="maxInMemorySize" value="100000000" />
    </bean>
    -->
    <!-- custom multi file resolver -->
    <!-- 
    <bean id="local.MultiCommonsMultipartResolver" class="egovframework.com.cmm.web.EgovMultipartResolver">
        <property name="maxUploadSize" value="100000000" />
        <property name="maxInMemorySize" value="100000000" />
    </bean>
    -->
    
    <!-- choose one from above and alias it to the name Spring expects -->
    <!--
    <alias name="local.MultiCommonsMultipartResolver" alias="multipartResolver" />
          
    <alias name="spring.RegularCommonsMultipartResolver" alias="multipartResolver" />
    -->
	
</beans>

 

728x90
반응형

'프로그램 > JPA' 카테고리의 다른 글

context-mapper.xml  (0) 2021.07.02
context-jpa-repository.xml  (0) 2021.07.02
context-hibernate.xml  (0) 2021.07.02
context-datasource.xml 설정 파일  (0) 2021.07.02
전자정부 소스 자동 생성 툴  (0) 2021.06.30

댓글



"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."

loading