공부/넥사크로

전자정부 표준 프레임워크와 넥사크로 연동하기_1

데부한 2021. 8. 22. 23:31
반응형

 

 

먼저 톰캣 경로를 간단하게 바꿔준다.

톰캣 더블클릭

 

Modules 선택

 

 

Path 첫 번째 줄 선택 후 Edit

 

Path에 '/'만 남기고 지운다.

 

저장 후 서버 재실행

좌 : 변경 전,  우 : 변경 후

반응형

 

pom.xml 추가

<!-- ############  NEXACROPLATFORM UIADAPTER17 REPOSITORY  ############ -->
<repository>
  <id>tobesoft</id>
  <url>http://mangosteen.tobesoft.co.kr/nexus/repository/maven-public</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>
<!-- ############  NEXACROPLATFORM UIADAPTER17 LIBRARY  ############ -->
<dependency>
  <groupId>com.nexacro.uiadapter17.spring</groupId>
  <artifactId>uiadapter17-spring-core</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.nexacro.uiadapter17.spring</groupId>
  <artifactId>uiadapter17-spring-dataaccess</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.apache.ibatis</groupId>
      <artifactId>ibatis-sqlmap</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.nexacro.uiadapter17.spring</groupId>
  <artifactId>uiadapter17-spring-excel</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <exclusions>
    <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
    </exclusion>
  </exclusions>
</dependency>

 

pom.xml에 추가 후 저장

 

 

dispatcher-servlet.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:p="http://www.springframework.org/schema/p"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
                http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

    <context:component-scan base-package="egovframework">
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
    </context:component-scan>

    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
        <property name="interceptors">
            <list>
                <ref bean="localeChangeInterceptor" />
            </list>
        </property>
    </bean>
    
    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
      <property name="defaultLocale" value="ko" />
    </bean>
    <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
        <property name="paramName" value="lang" />
    </bean>
    
    <!-- /////////////////////////////////// 넥사크로플랫폼 UIADAPTER17 설정 시작 /////////////////////////////////// -->
    <bean id="nexacroFileView"    class="com.nexacro.uiadapter17.spring.core.view.NexacroFileView" />
    <bean id="nexacroView"        class="com.nexacro.uiadapter17.spring.core.view.NexacroView">
        <property name="defaultContentType" value="PlatformXml" />
        <property name="defaultCharset" value="UTF-8" />
    </bean>
    
    <!-- 넥사크로플랫폼 RequestMappingHandlerAdapter 구현체 등록 -->
    <bean class="com.nexacro.uiadapter17.spring.core.resolve.NexacroRequestMappingHandlerAdapter" p:order="0">
        <property name="customArgumentResolvers">
            <list><bean class="com.nexacro.uiadapter17.spring.core.resolve.NexacroMethodArgumentResolver" /></list>
        </property>
        <property name="customReturnValueHandlers">
            <list>
                <bean class="com.nexacro.uiadapter17.spring.core.resolve.NexacroHandlerMethodReturnValueHandler">
                    <property name="view"     ref="nexacroView" />
                    <property name="fileView" ref="nexacroFileView" />
                </bean>
            </list>
        </property>
    </bean>
    
    <!-- 넥사크로플랫폼 EXCEPTION-RESOLVER 등록 -->
    <bean id="exceptionResolver" class="com.nexacro.uiadapter17.spring.core.resolve.NexacroMappingExceptionResolver" p:order="1">
        <property name="view" ref="nexacroView" />   
        <property name="shouldLogStackTrace" value="true" />   
        <property name="shouldSendStackTrace" value="true" />
        <!-- shouldSendStackTrace 가 false 일 경우 nexacro platform으로 전송되는 에러메시지  -->
        <!-- <property name="defaultErrorMsg" value="An Error Occured. check the ErrorCode for detail of error infomation" /> -->
        <property name="defaultErrorMsg" value="fail.common.msg" />
        <property name="messageSource" ref="messageSource" />   
    </bean>    
    <!-- /////////////////////////////////// 넥사크로플랫폼 UIADAPTER17 설정 끝 /////////////////////////////////// -->
</beans>

 

 

반응형

context-nexacro.xml 생성

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:p="http://www.springframework.org/schema/p" 
    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.0.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
        ">
        
  <bean id="applicationContextProvider" class="com.nexacro.uiadapter17.spring.core.context.ApplicationContextProvider" lazy-init="false" />

  <bean id="hsqlDbms"   class="com.nexacro.uiadapter17.spring.dao.dbms.Hsql" />
<!-- 
  <bean id="oracleDbms" class="com.nexacro.uiadapter17.spring.dao.dbms.Oracle" />
  <bean id="mssqlDbms"  class="com.nexacro.uiadapter17.spring.dao.dbms.Mssql" />
  <bean id="mysqlDbms"  class="com.nexacro.uiadapter17.spring.dao.dbms.Mysql" />
  <bean id="tiberoDbms" class="com.nexacro.uiadapter17.spring.dao.dbms.Tibero" />
 -->  
  <bean id="dbmsProvider" class="com.nexacro.uiadapter17.spring.dao.DbVendorsProvider">
      <property name="dbvendors">
          <map>
           <entry key="HSQL Database Engine" value-ref="hsqlDbms"/>
<!-- 
           <entry key="Oracle"     value-ref="oracleDbms"/>
           <entry key="SQL Server" value-ref="mssqlDbms"/>
           <entry key="MySQL"      value-ref="mysqlDbms"/>
              <entry key="Tibero"     value-ref="tiberoDbms"/>
 -->
          </map>
      </property>
  </bean>
</beans>

 

 

 

sql-mapper-config.xml 추가

  <!-- myBatis Inteceptor for get column information  -->
  <plugins>  
    <!-- NexacroMybatisMetaDataProvider :  Executor Plugin:쿼리를 실행하며, 
        List 형태의 데이터 조회 시 조회된 결과가 0건일 경우 결과 메타데이 터 정보를 조회
        resultType이 Map 일 경우 추가적으로 메타데이터 조회를 위한 쿼리를 실행한다.  -->
    <plugin interceptor="com.nexacro.uiadapter17.spring.dao.mybatis.NexacroMybatisMetaDataProvider" />
    <!-- NexacroMybatisResultSetHandler :ResultSetHandler Plugin – Executor Plugin에서 메타데이터 조회를 위해 쿼리를 실행하였을 경우에만 동작, 
        ResultSetMetaData 와 resultType에 존재하는 필드 정보를 확인하여 메타데이터 정보를 조회 한 다.  -->
    <plugin interceptor="com.nexacro.uiadapter17.spring.dao.mybatis.NexacroMybatisResultSetHandler" />
  </plugins>

 

 

프로젝트 클린 후 서버 실행해서 콘솔에 에러 없는지 확인

 


이전 게시글

 

전자정부 표준 프레임워크 MariaDB 연동

패키지, 파일 생성 MariaDB 테이블 생성, 데이터 추가 # 테이블 생성 CREATE TABLE `tbl_emp` ( `NO` INT(11) NOT NULL COMMENT '사번', `NAME` VARCHAR(50) NULL DEFAULT NULL COMMENT '이름', `JOB` VARCHAR(..

devhan.tistory.com

 

다음 게시글

 

전자정부 표준 프레임워크와 넥사크로 연동하기_2

넥사크로 프로젝트 생성 경로는 이클립스 워크스페이스 src\main에 위치 쭉 Next 클릭 후 Finish 이클립스 상에서 프로젝트 src폴더 Refresh Generate Path 설정 Yes  컴포넌트 배치  Form_Work 클릭 확인..

devhan.tistory.com

 

반응형