표준프레임워크로구성된컨텐츠를솔루션에적용하는것에문제가없는지확인 ( S <- R ) 1. sample( 게시판 ) 프로젝트생성 (egovframe Web Project > next -> generate example -> finish).
2. 표준프레임워크개발환경에솔루션프로젝트추가. ( File -> Import -> Existring Projects into Workspace )
3. 솔루션프로젝트에 sample( 게시판 ) 프로젝트의컨텐츠를추가하여상호기능동작확인. /java/egovframework.example.* /resources/egovframework/message /resources/egovframework/sqlmap /resources/meta-inf/spring/context-idgen.xml /resources/meta-inf/spring/context-properties.x ml /resources/meta-inf/spring/context-sqlmap.xml /resources/meta-inf/spring/context-validator.xml
/src/main/webapp/css /src/main/webapp/images /src/main/webapp/web-inf/config/egovframework /validator/* /src/main/webapp/web-inf/cmmn /src/main/webapp/web-inf/sample * egovframe Web Project 파일복사.
src\main\resources\meta-inf\spring\context-common.xml 위그림과같이추가. <context:component-scan base-package="egovframework"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.controller" /> </context:component-scan> <value>classpath:/egovframework/message/message-common</value>
src\main\webapp\web-inf\spring\dispatcher-servlet.xml 하단추가. <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> <!-- For Pagination Tag --> <bean id="imagerenderer" class="egovframework.example.cmmn.web.egovimgpaginationrenderer"/> <bean id="paginationmanager" class="egovframework.rte.ptl.mvc.tags.ui.pagination.defaultpaginationmanager"> <property name="renderertype"> <map> <entry key="image" value-ref="imagerenderer"/> </map> </property> </bean> <!-- /For Pagination Tag --> <mvc:view-controller path="/cmmn/validator.do" view-name="cmmn/validator"/> mysql 테이블생성및데이터삽입. ( egovframe Web Project :: src\main\resources\db\sampledb.sql 참조 ) CREATE TABLE SAMPLE(ID VARCHAR(16) NOT NULL PRIMARY KEY,NAME VARCHAR(50),DESCRIPTION VARCHAR(100),USE_YN CHAR(1),REG_USER VARCHAR(10)); CREATE TABLE IDS(TABLE_NAME VARCHAR(16) NOT NULL PRIMARY KEY,NEXT_ID DECIMAL(30) NOT NULL); INSERT INTO SAMPLE VALUES('SAMPLE-00001','Runtime Environment','Foundation Layer','Y','eGov'); INSERT INTO SAMPLE VALUES('SAMPLE-00002','Runtime Environment','Persistence Layer','Y','eGov');... INSERT INTO IDS VALUES('SAMPLE',115);
표준프레임워크프로젝트와솔루션연동시기능이정상동작하는지확인 ( R <- S ) 1. Simple Homepage Template 프로젝트생성 ( 프로젝트명 : sht). 2-1. 솔루션의 DB 에맞춰 Simple Homepage Template 프로젝트 DB 설정변경및 DB 정보생성. => 기본셋팅되어있는 hsql 사용하고 로컬개발환경구축.pdf 설명되어있는 mysql DB 를사용함.
2-2. 기본적용된 hsqldb 와함께솔루션 DB 이중구성설정. ( 기본값사용 ) ( hsql, mysql 제외주석 / 구축된 mysql id,pw,db 추가 ) <!-- mysql --> <bean id="datasource-mysql" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close"> <property name="driverclassname" value="com.mysql.jdbc.driver"/> <property name="url" value="jdbc:mysql://127.0.0.1:3306/cori" /> <property name="username" value="cori"/> <property name="password" value="cori6718"/> </bean>
3. 솔루션을 Simple Homepage Template 프로젝트에적용하여상호기능동작확인. (.java 추가 ) (.xml 파일, META-INF, captcha_sounds 폴더추가 )
src/main/webapp/asset/ src/main/webapp/captcha/ src/main/webapp/favicon.ico src/main/webapp/file_uploder_html5.jsp src/main/webapp/file_uploader.jsp src/main/webapp/robots.txt src/main/webapp/web-inf/lib/simplecaptcha-1.2.1.jar src/main/webapp/web-inf/file/ src/main/webapp/web-inf/jsp/adm/ src/main/webapp/web-inf/jsp/board/ src/main/webapp/web-inf/jsp/content/ src/main/webapp/web-inf/jsp/layout/ src/main/webapp/web-inf/jsp/member/ src/main/webapp/web-inf/jsp/_head.jsp src/main/webapp/web-inf/jsp/blank.jsp src/main/webapp/web-inf/jsp/block.jsp src/main/webapp/web-inf/jsp/captcha.jsp src/main/webapp/web-inf/jsp/head_blank.jsp src/main/webapp/web-inf/jsp/head.jsp src/main/webapp/web-inf/jsp/tail_blank.jsp src/main/webapp/web-inf/jsp/tail.jsp * 솔루션에서파일복사.
( src/main/webapp/web-inf/config/egovframework/springmvc/egov-com-servlet.xml ) 하단에추가. <context:component-scan base-package="com.interfo.*"> <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"> <property name="webbindinginitializer"> <bean class="com.interfo.cori.common.bindinginitializer"/> </property> </bean> <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" /> <!-- 쿠키를이용한 Locale 이용시 <bean id="localeresolver" class="org.springframework.web.servlet.i18n.cookielocaleresolver"/> --> <bean id="localechangeinterceptor" class="org.springframework.web.servlet.i18n.localechangeinterceptor"> <property name="paramname" value="language" /> </bean>
( src\main\resources\egovframework\spring\com\context-common.xml ) 위그림과같이추가. <context:component-scan base-package="com.interfo.*"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.controller" /> </context:component-scan> <value>classpath:/meta-inf/message/message-common</value> (src\main\resources\egovframework\spring\com\context-mapper.xml) <property name="datasource" ref="datasource-mysql" />
( 라이브러리추가 ) /pom.xml :: 203(<groupId>com.ibm.icu</groupId>) 라인하단추가.
<!-- Java Mail API --> <dependency> <groupid>javax.mail</groupid> <artifactid>mail</artifactid> <version>1.4.3</version> </dependency> <!-- thumbnailator --> <dependency> <groupid>net.coobird</groupid> <artifactid>thumbnailator</artifactid> <version>0.4.8</version> </dependency> <!-- https://mvnrepository.com/artifact/org.json/json --> <dependency> <groupid>org.json</groupid> <artifactid>json</artifactid> <version>20160810</version> </dependency> <!-- mysql --> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.31</version> </dependency> <!-- mybatis --> <dependency> <groupid>org.mybatis</groupid> <artifactid>mybatis</artifactid> <version>3.2.4</version> </dependency> ( 정상가동확인 )
( 메이븐빌드 )
4. Simple Homepage Template 프로젝트와솔루션의권한처리공유 (sht 계정 : admin / 1) - Simple Homepage Template 프로젝트에로그인하여솔루션의로그인후권한이적용되도록수정 ( Simple Homepage Template 로그인 ) ( 솔루션글쓰기 ) - 솔루션에로그인하여 Simple Homepage Template 프로젝트의로그인후권한이적용되도록수정 ( 솔루션로그인 ) ( Simple Homepage Template 글쓰기 )