select
    machine "hostname",
    username "username",
    osuser "OS User",
    program "Program",
    sid||','||serial# "ID",
    last_call_et "Last Activity",
    status
from v$session
where
    username is not null
order by status desc, last_call_et desc;


select
    b.machine "hostname",
    b.username "username",
    b.osuser "OS User",
    b.program "Program",
    a.tablespace_name "TableSpace",
    row_wait_file# "File Number",
    row_wait_block# "Block Number",
    c.owner,
    c.segment_name,
    c.segment_type
from
    dba_data_files a,
    v$session b,
    dba_extents c
where
    b.row_wait_file# = a.file_id
    and c.file_id = row_wait_file#
    and row_wait_block# between c.block_id and c.block_id + c.blocks -1
    and row_wait_file# <> 0
    and type = 'USER'


'Database > Oracle' 카테고리의 다른 글

사용자 생성 및 권한  (0) 2015.05.26
Session 확인  (0) 2015.04.23
MD5 함수  (0) 2014.05.08
ORA-01940: 현재 접속되어 있는 사용자는 삭제할 수 없습니다  (0) 2014.04.03
날짜의 일자 및 시간 차이 구하기  (0) 2014.02.17
public class Javatest{
    public static void main(String args[]) {
        try{
            String charSet[] = {"utf-8","euc-kr","8859_1"};
            String fileName = "테스트";
            for(int i = 0; i < charSet.length; i++) {
                for(int j = 0; j < charSet.length; j++) {
                    System.out.println(charSet[i] + " to " + charSet[j] + " = " + new String(fileName.getBytes(charSet[i]),charSet[j]));
                }
            }
        }catch(Exception ex){
        }
    }
}
[출처] java 인코딩 테스트를 한번에 (한글깨졌을때, 한글깨짐..)|작성자 웹사이더


'JAVA > Common' 카테고리의 다른 글

[JAVA] 압축 파일 생성 및 풀기  (0) 2018.05.03
ArrayList 정렬 및 자르기  (0) 2016.03.07
형 변환 모음...  (0) 2015.05.28
String.format()을 이용하여 Date 표현하기  (0) 2013.10.01

MySql

<insert id="insertContent" parameterClass="content">

    <![CDATA[    

INSERT INTO CONTENT (        

CREATED_DATE, TITLE, CONTENT, CONTENT_TYPE    

) VALUES (

        now(), #title#, #content#, #contentType#   

)    

]]>    

<selectKey keyProperty="seqId" resultClass="int">        

SELECT LAST_INSERT_ID()    

</selectKey>

</insert>


MSSQL

<insert id="createProjectBasicInfo" parameterClass="prjIdx">

    <selectKey keyProperty="prj_info_seq" resultClass="int">

       INSERT INTO PRJ_INFO (             ...         ) VALUES (              ...         )        

SELECT SCOPE_IDENTITY()

    </selectKey>

</insert>


Oracle

<insert id="insert_message" parameterClass="java.util.HashMap">    

<selectKey keyProperty="message_id" resultClass="Integer">

        SELECT message_id_seq.nextval FROM DUAL

</selectKey>

INSERT INTO guestbook_message (

message_id, guest_name, password, message

) VALUES(

#message_id#, #gName#, #pw#, #ms#


</insert>

 

'Database > 공통' 카테고리의 다른 글

DATABASE별 결과 값 RANDOM 으로 나오게 하기  (0) 2015.04.23
Project에서 빨강색 x표 뜨는거 정말 거슬려서 없애기로 결정합니다..

저와 같은 사람들이 있을 까봐 올립니다..

저 또한 담에 또 참고 하기 위해서..^ ^

1. 프로젝트에서 Property 창을 엽니다.



2. 왼쪽메뉴에서 JavaScript >> Include Path 메뉴를 선택합니다.



3. 상단 탭중에 Source 탭을 엽니다.
4. Excluded 를 클릭하고 오른쪽 Edit 버튼을 클릭합니다.



5. Exclusion patterns 에서 Add 버튼을 클릭합니다.



6. "*-/jquery*.js" 라고 입력을 하고 OK 버튼을 클릭합니다.


7. 프로젝트 Clean 합니다.

위의 순서대로 하면 프로젝트에서 x표 뜨는건 없앨 수 있습니다.


Eclipse 에서 Code Template를 사용하여 User 명을 입력 하고자 하면 기본으로 컴퓨터의 이름을 따르게 됩니다.
/-*
 * @author ${user}
 *-

그런데 이름을 변경하고자 할 경우 아래와 같이 추가를 해 주면 됩니다.

eclipse.ini
-Duser.name = "변경하고자 하는 이름"


Tiles에서 현재 URL을 가져오려고 request.getRequestURI() 를 출력하면 마지막 호출 Tiles의 정보를 호출한다. 결과적으로 현재 URL의 정보를 가지고 올 수 없다. 그래서 구글링 시작..ㅡㅡ;;

방법 :
request.getAttribute(.....);

요청 URL : http://localhost:9090/mani-examples/jsp/Forwarder.jsp?name=Mani

현재 URL 정보 출력
javax.servlet.forward.request_uri = /mani-examples/jsp/Forwarder.jsp
javax.servlet.forward.servlet_path = /jsp/Forwarder.jsp
javax.servlet.forward.context_path = /mani-examples
javax.servlet.forward.path_info = null
javax.servlet.forward.query_string = name=Mani

Tiles 정보 출력
javax.servlet.include.request_uri = /mani-examples/jsp/Included.jsp
javax.servlet.include.servlet_path = /jsp/Included.jsp
javax.servlet.include.context_path = /mani-examples
javax.servlet.include.path_info = null
javax.servlet.include.query_string = null


JSTL로 Scriptlet 변수 접근
<%      String myVariable="Test";      pageContext.setAttribute("myVariable", myVariable); %> <?xml:namespace prefix ="c" /> <c:out value="myVariable">

Scriptlet으로 JSTL 변수 접근
<?xml:namespace prefix="c" /> <c:set value="Test" var="myVariable"> <% String myVariable = (String)pageContext.getAttribute("myVariable"); out.print(myVariable); %>


ORACLE
SELECT * FROM TABLE_NAME SAMPLE (3)
SELECT * FROM (
SELECT * FROM TABLE_NAME ORDER BY DBMS_RANDOM.VALUE
)
WHERE ROWNUM < 3 

MSSQL
SELECT TOP 3 * FROM TABLE_NAME ORDER BY NEWID()

MYSQL
SELECT * FROM TABLE_NAME ORDER BY RAND() LIMIT 0,3

SecurityConfig.java는 Security 설정을 담당합니다.

설명을 드리기에 앞서 전에 web.xml에서 springSecurityFilterChain 을 설정하던 부분이 있습니다.

JavaConfig 설정에서는 이 부분 설정을 다음과 같이 설정을 합니다.

package com.intercast.web.config.security;

import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;

public class SpringSecurityInitializer extends
  AbstractSecurityWebApplicationInitializer {

}

이러한 식으로 AbstractSecurityWebApplicationInitializer 을 상속받아 생성해 놓아야 합니다.

그러면 설정완료....^^

 

그럼 이제 SecurityConfig 파일에 대하여 설명하도록 하겠습니다.

 

package com.intercast.web.config.security;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.vote.AffirmativeBased;
import org.springframework.security.access.vote.RoleVoter;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.access.expression.WebExpressionVoter;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;

import com.intercast.security.access.expression.CustomWebSecurityExpressionHandler;
import com.intercast.security.authentication.CustomAuthenticationFailureHandler;
import com.intercast.security.authentication.CustomAuthenticationSuccessHandler;
import com.intercast.security.service.CustomUserDetailsService;

@Configuration
/*
 * @EnableWebSecurity annotation을 반드시 가져야 합니다.
 */
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

 /*
  * DB 접속을 통하여 사용자 정보 및 권한을 확인할 Service
  */
 @Autowired CustomUserDetailsService userService;

 

 /**
  * AuthenticationManager 설정
  *
  * <security:authentication-manager alias="authenticationManager">
  *  <security:authentication-provider user-service-ref="userService">
  *   <security:password-encoder ref="passwordEncoder" />
  *  </security:authentication-provider>
  * </security:authentication-manager>
  *
  * <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
     *  <constructor-arg value="256" />
    *  </bean>
  */
 @Override
 protected void configure(AuthenticationManagerBuilder auth)
   throws Exception {
  auth
   .userDetailsService(userService)
   .passwordEncoder(new ShaPasswordEncoder(256));
 }

 

 /**
  * Security 권한체크에 해당하지 않도록 설정을 합니다.
  * 해당 항목은 Security 4 에서 부터 적용이 됩니다.
  * <security:http pattern="/resources/**" security="none" />
  */
 @Override
 public void configure(WebSecurity web) throws Exception {
  web
   .ignoring()
    .antMatchers("/resources/**");
 }

 

 /**
  * <security:http auto-config="true" use-expressions="true" access-decision-manager-ref="accessDecisionManager">
     *
  *   <security:custom-filter ref="requestProcessingFilter" before="FORM_LOGIN_FILTER" />
     *
  *   <security:intercept-url pattern="/favicon.ico" access="permitAll" />
  *   <security:intercept-url pattern="/login.htm" access="isAnonymous()" />
  *   <security:intercept-url pattern="/failureLogin.htm" access="isAnonymous()" />
  *   <security:intercept-url pattern="/index.htm" access="permitAll" />
  *   <security:intercept-url pattern="/admsys/**" access="hasRole('SYSADM')"/>
  *   <security:intercept-url pattern="/**" access="hasCustomRole()" />
     *
  *   <!--
  *   Security 4에서는 CSRF 설정을 해줘야 합니다. 보안상 처리라고 하는데 사용하지 않는 것으로 처리하였습니다.
  *   CSRF 사용안함 설정
  *   -->
  *   <security:csrf disabled="true"/>
     *
  *   <security:form-login
  *    login-page="/login.htm"
  *    login-processing-url="/login/process"
  *    username-parameter="userId"
  *    password-parameter="userPass"
  *    default-target-url="/"
  *    authentication-success-handler-ref="customeAuthenticationSuccessHandler"
  *    authentication-failure-handler-ref="customeAuthenticationFailureHandler" />
     *
  *   <security:logout logout-url="/logout.htm" logout-success-url="/login.htm"/>
  *   <security:access-denied-handler error-page="/accessDenied.htm"/>
  * </security:http>
  */
 @Override
 protected void configure(HttpSecurity http) throws Exception {
  http
   .csrf().disable()
   .authorizeRequests()
    .accessDecisionManager(accessDecisionManager())
    .antMatchers(
       "/favicon.ico",
       "/index.htm").permitAll()
    .antMatchers(
       "/login.htm",
       "/failureLogin.htm").anonymous()
    .antMatchers("/admsys/**"). hasAnyAuthority("SYSADM")
    .anyRequest().access("hasCustomRole()")
    .and()
   .formLogin()
    .usernameParameter("userId")
    .passwordParameter("userPass")
    .loginPage("/login.htm")
    .loginProcessingUrl("/login/process")
    .successHandler(customAuthenticationSuccessHandler())
    .failureHandler(customAuthenticationFailureHandler())
    .permitAll()
    .and()
   .logout()
    .logoutUrl("/logout.htm")
    .logoutSuccessUrl("/")
    .permitAll()
    .and()
   .exceptionHandling().accessDeniedPage("/accessDenied.htm");
 }

 

 /**
  * AuthenticationSuccessHandler 설정
  * 로그인 실패시 처리되는 Handler입니다.
  *
  * <bean id="customeAuthenticationFailureHandler" class="com.intercast.security.handler.CustomAuthenticationFailureHandler">
  *  <property name="defaultFailureUrl" value="/failureLogin.htm" />
  * </bean>
  * @return
  */
 public AuthenticationFailureHandler customAuthenticationFailureHandler() {
  CustomAuthenticationFailureHandler handler = new CustomAuthenticationFailureHandler();
  handler.setDefaultFailureUrl("/failureLogin.htm");
  return handler;
 }

 

 /**
  * AuthenticationSuccessHandler 설정
  * 로그인 성공시 처리되는 Handler입니다.
  *
  * <bean id="customeAuthenticationSuccessHandler" class="com.intercast.security.handler.CustomAuthenticationSuccessHandler">
  *  <property name="defaultTargetUrl" value="/index.htm" />
  * </bean>
  * @return
  */
 public AuthenticationSuccessHandler customAuthenticationSuccessHandler() {
  CustomAuthenticationSuccessHandler handler = new CustomAuthenticationSuccessHandler();
  handler.setDefaultTargetUrl("/index.htm");
  return handler;
 }

 

 /**
  * AccessDecisionManager 설정
  *
  * Security 설정중 http.authorizeRequests().accessDecisionManager(accessDecisionManager()) 에서 호출합니다.
  * 권한 체크에 대한 여러가지 방법 중 AffirmativeBased 사용
  *
  * <bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
  *  <constructor-arg>
  *   <list>
  *    <ref bean="expressionVoter" />
  *   </list>
  *  </constructor-arg>
  *  <property name="allowIfAllAbstainDecisions" value="false"/>
  * </bean>
  *
  * @return
  */
 @Bean
 public AffirmativeBased accessDecisionManager() {
  List<AccessDecisionVoter<?>> voters = new ArrayList<AccessDecisionVoter<?>>();
  voters.add(expressionVoter());

  AffirmativeBased affirmativeBased = new AffirmativeBased(voters);
  affirmativeBased.setAllowIfAllAbstainDecisions(false);
  return  affirmativeBased;
 }


 /**
  * 사용자 정의 권한을 사용하고자 할 경우 생성합니다.
  * WebExpressionVoter에 생성한 권한 설정 Handler을 SET 합니다.
  *
  * <bean id="customExpressionHandler"
  *  class="com.intercast.security.handler.CustomWebSecurityExpressionHandler">
  *   <property name="defaultRolePrefix" value="" />
  * </bean>
  *
  * <bean id="expressionVoter"
  *  class="org.springframework.security.web.access.expression.WebExpressionVoter">
  *  <property name="expressionHandler" ref="customExpressionHandler"></property>
  * </bean>
  *
  * @return
  */
 @Bean
 public WebExpressionVoter expressionVoter() {
  WebExpressionVoter voter = new WebExpressionVoter();

  CustomWebSecurityExpressionHandler handler = new CustomWebSecurityExpressionHandler();
  handler.setDefaultRolePrefix("");
  voter.setExpressionHandler(handler);
  return voter;
 }
}

 

JavaConfig 를 통하여 Security를 설정할 경우에는 반드시 WebSecurityConfigurerAdapter를 상속받아야 하며

@EnableWebSecurity Annotation을 설정해야 합니다.

 

또한 AuthenticationProvider을 별도의 Provider로 설정할 수 있으나 나는 아래와 같이 configure(AuthenticationManagerBuilder auth)를 Override 하여 사용하였습니다.

@Override
 protected void configure(AuthenticationManagerBuilder auth)
   throws Exception {
  auth
   .userDetailsService(userService)
   .passwordEncoder(new ShaPasswordEncoder(256));
 }

 

그리고 Custom 권한 체크를 위해서 Voter을 생성하고 Handler을 등록 후 사용법을 몰라 한참을 찾다가...ㅡㅡ;;

단순히 access를 사용하여 설정하면 된다는걸.... 알게 되었습니다..ㅡㅡ;;;

이거 땜시 몇시간을 헛수고 했네요..ㅋㅋ

 http
   .authorizeRequests()

   .anyRequest().access("hasCustomRole()")

 

또한가지..

Spring Security 4.* 로 넘어오면서 또 하나 고생한것이 바로 CSRF 입니다.

이것은 CSRF 공격을 막기 위해 설정하는 부분인데 사용할 경우 Login Form에서 넘길 때 해당 정보도 같이 넘겨줘야 한다고 합니다.

그래서 나는 과감하게 disable() 처리 하였습니다.

처리 하지 않을 시

HTTP Status 403 - Expected CSRF token not found. Has your session expired?

애러가 발생합니다...ㅋ

유의 하시기 바랍니다.

 

여기까지 XML설정을 JAVA Base로 바꾸는 작업을 하였습니다.

아직 하면서 내공이 부족하여.. 모르고 서핑에서 사용해야 하니까 사용하는 부분이 많은데..ㅜㅜ

더 많은 공부를 해야 한다는 생각이 팍팍 들게 하는 공부였습니다...ㅋㅋ

더군다가 개발을 2년이나 안하고 있던 터라...ㅋㅋ

지금은 PM 겸 PL을 하고 있지만 개발 공부는 끝도 없이 해야 한다는 생각을 합니다..ㅋ

개발을 왜 공부하냐는 분들도 계시지만 전 개발이 좋고 또 PM 또는 PL도 깊이는 아니더라도 이쪽일을 하려면 어느정도는 알고 있어야 한다는 생각을 합니다..ㅋㅋ

저만의 생각일 수도 있겠지만..ㅋㅋ

여튼 그렇습니다..ㅋ

누가 보실지는 모르겠지만 다들 힘내시고 프로그램은 잼납니다...ㅋㅋ

열씨미들 하세요...^^

DatabaseConfig.java는 Database 접속 및 SqlSession 설정을 담당합니다.

package com.intercast.web.config;

import java.io.IOException;

import javax.sql.DataSource;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

 

@Configuration
/*
 * Spring 프레임워크의 어노 테이션 기반 트랜잭션 관리를 사용할 수 있도록 한다.
 * <tx:annotation-driven>
 */
@EnableTransactionManagement
public class DatabaseConfig {

 @Autowired
    ApplicationContext applicationContext;


 /**
  * DataSource 설정
  * <bean id="dataSource"
  *  class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  *
  *  <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
  *  <property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
  *  <property name="username" value="intercast" />
  *  <property name="password" value="pass123!" />
  * </bean>
  *
  * @return
  */
 @Bean
 public DataSource dataSource() {
  DriverManagerDataSource dataSource = new DriverManagerDataSource();
  dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");
  dataSource.setUrl("jdbc:oracle:thin:@localhost:1521:xe");
  dataSource.setUsername("intercast");
  dataSource.setPassword("pass123!");
  return dataSource;
 }

 

 /**
  * TransactionManager설정
  *
  * <bean id="transactionManager"
  *  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  *  <property name="dataSource" ref="dataSource"></property>
  * </bean>
  *
  * @return
  */
 @Bean
 public PlatformTransactionManager transactionManager() {
  return new DataSourceTransactionManager(dataSource());
 }

 

 /**
  * SqlSessionFactory 설정
  *
  * <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  *  <property name="dataSource" ref="dataSource" />
  *  <property name="configLocation" value="classpath:mybatis/configuration.xml" />
  * <property name="mapperLocations" value="classpath:mybatis/mappers/** /*.xml" />
  * </bean>
  *
  * @param dataSource
  * @param applicationContext
  * @return
  * @throws IOException
  */
 @Bean
 public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource,
   ApplicationContext applicationContext) throws IOException {

  SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();

  factoryBean.setDataSource(dataSource);
  factoryBean.setConfigLocation(applicationContext.getResource("classpath:mybatis/configuration.xml"));
  factoryBean.setMapperLocations(applicationContext.getResources("classpath:mybatis/mappers/**/*.xml"));

  return factoryBean;
 }

 

 /**
  * SqlSessionTemplate 설정
  *
  * <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
  *  <constructor-arg ref="sqlSessionFactory" />
  * </bean>
  *
  * @param sqlSessionFactory
  * @return
  */
  @Bean
  public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
      return new SqlSessionTemplate(sqlSessionFactory);
  }

}

CommonConfig.java 는 제가 임의로 만든 설정파일이며 없어도 무관합니다.

 

package com.intercast.web.config;

import javax.validation.Validator;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

@Configuration
/*
 * <context:component-scan base-package="com.intercast">
 *  <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
 * </context:component-scan>
 */
@ComponentScan(
  basePackages="com.intercast",
  excludeFilters={
    @ComponentScan.Filter(Controller.class)
  }
 )
public class CommonConfig {

 /**
  * 해당 설정이 없을 경우 @Autowired 를 찾지 못하는 경우가 생깁니다.
  * 하여 Validator을 Bean으로 설정을 합니다.
  * @return
  */
 @Bean
 public Validator localValidatorFactoroyBean() {
  return new LocalValidatorFactoryBean();
 }

}

 

해당 파일에서 중요한 public Validator localValidatorFactoroyBean() 부분은  부분입니다.

위에 주석에 설명되어 있는바와 같이 없을 경우 @Autowired에서 오류가 발생합니다.

그래서 필히 넣어 주시고 작업을 하시기 바랍니다.

 

WebMvcConfig.java 파일은 application-context.xml 파일을 대체하는 파일입니다.

WebMvcConfig을 설명하기 앞서 WebInitializer.java에서 호출한 설정파일 AppConfig 파일에 대해 간단히 설명하도록 하겠습니다.

 

AppConfig.java

package com.intercast.web.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.intercast.web.config.security.SecurityConfig;

@Configuration
@Import({WebMvcConfig.class, CommonConfig.class, SecurityConfig.class})
public class AppConfig {

}

정말 간단합니다.

붉은색으로 처리한 부분을 보시면 설정파일이라고 선언을 하고

사용하고자 하는 설정 파일들은 @Import 해 주면 끝입니다. 추가적으로 더 생성이 되면 @Import에 더 추가 해 주시면 됩니다. 

간단하죠...ㅋㅋ

 

그럼 다음으로 WebMvcConfig.java 입니다.

package com.intercast.web.config;

import java.util.HashMap;
import java.util.Map;

import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import org.springframework.web.servlet.view.UrlBasedViewResolver;
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesView;

import com.intercast.util.pagination.CommonPaginationRenderer;

import egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationManager;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationRenderer;

 

@Configuration
/* <mvc:annotation-driven /> */
@EnableWebMvc


/*
<context:component-scan base-package="com.intercast">
  <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>
*/
@ComponentScan(
  basePackages="com.intercast",
    includeFilters={
    @ComponentScan.Filter(Controller.class)
  },
  excludeFilters={
    @ComponentScan.Filter(Service.class),
    @ComponentScan.Filter(Repository.class)
  }
 )
public class WebMvcConfig extends WebMvcConfigurerAdapter {

 //<resources location="/resources/" mapping="/resources/**">에 해당됨.
 @Override
 public void addResourceHandlers(ResourceHandlerRegistry registry) {
  registry.addResourceHandler("/resources/**").addResourceLocations("/resources/").setCachePeriod(31556926);
 }

 

 //<mvc:default-servlet-handler>에 해당됨.
 @Override
 public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
  configurer.enable();
 }

 

 /**
  * <pre>
  * Return Type을 JSON으로 사용하고 싶을 경우 설정을 해줘야 한다.<br />
  * 없을 경우
  * "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers."
  * 오류가 발생한다. <br />
  *
  * XML 설정은 아래와 같다.
  * <mvc:annotation-driven  content-negotiation-manager="contentNegotiationManager" />
  * <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
  *      <property name="favorPathExtension" value="false" />
  *      <property name="favorParameter" value="true" />
  *      <property name="mediaTypes" >
  *           <value>
  *                json=application/json
  *                xml=application/xml
  *           </value>
  *      </property>
  * </bean>
  * </pre>
  */
 @Override
 public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
  configurer.favorPathExtension(false)
     .favorParameter(true)
     .defaultContentType(MediaType.APPLICATION_JSON)
     .mediaType("xml", MediaType.APPLICATION_ATOM_XML)
     .mediaType("json", MediaType.APPLICATION_JSON);
 }

 

 /* <mvc:view-controller path="/accessDenied" view-name="error/accessDenied"/> */
 @Override
 public void addViewControllers(ViewControllerRegistry registry) {
  registry.addViewController("/accessDenied.htm").setViewName("error/accessDenied");
 }

 

 /**
  * Tiles 설정파일
  *
  * <bean id="titlesConfigurer"
  *  class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
  *  <property name="definitions">
  *   <list>
  *    <value>/WEB-INF/config/tiles-defs.xml</value>
  *   </list>
  *  </property>
  * </bean>
  */
 @Bean
 public TilesConfigurer tilesConfigurer() {
  TilesConfigurer configure = new TilesConfigurer();
  configure.setDefinitions("/WEB-INF/config/tiles-defs.xml");;
  return configure;
 }

 

 /**
  * <bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  *  <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"></property>
  *  <property name="order" value="1"></property>
  * </bean>
  */
 @Bean
 public UrlBasedViewResolver urlBasedViewResolver() {
  UrlBasedViewResolver resolver = new UrlBasedViewResolver();
  resolver.setViewClass(TilesView.class);
  resolver.setOrder(1);
  return resolver;
 }

 

 /**
  * <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  *  <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
  *  <property name="prefix" value="/WEB-INF/jsp/"></property>
  *  <property name="suffix" value=".jsp"></property>
  *  <property name="order" value="2"></property>
  * </bean>
  */
 @Bean
 public InternalResourceViewResolver internalResourceViewResolver() {
  InternalResourceViewResolver resolver = new InternalResourceViewResolver();
  resolver.setViewClass(JstlView.class);
  resolver.setPrefix("/WEB-INF/views/");
  resolver.setSuffix(".jsp");
  resolver.setOrder(2);
  return resolver;
 }

 

 /**
  * MultipartResolver 설정
  *
  * <bean id="multipartResolver"
  *  class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  *  <property name="maxUploadSize" value="200000000" />
  *  <property name="maxInMemorySize" value="100000000" />
  * </bean>
  */
 @Bean
 public MultipartResolver multipartResolver() {
  CommonsMultipartResolver resolver = new CommonsMultipartResolver();
  resolver.setMaxInMemorySize(100000000);
  resolver.setMaxUploadSize(200000000);
  return resolver;
 }

 

 /**
  * 전자정부프레임워크의 Paging 처리 Lib 사용하여
  * Paging 설정
  *
  * <bean id="commonPaginationRenderer" class="com.intercast.util.pagination.CommonPaginationRenderer" />
     *
  * <bean id="paginationManager" class="egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationManager">
  *  <property name="rendererType">
  *   <map>
  *    <entry key="common" value-ref="commonPaginationRenderer"></entry>
  *   </map>
  *  </property>
  * </bean>
  */
 @Bean
 public DefaultPaginationManager paginationManager() {
  DefaultPaginationManager manager = new DefaultPaginationManager();

  Map<String, PaginationRenderer> renderer = new HashMap<String, PaginationRenderer>();
  renderer.put("common", new CommonPaginationRenderer());
  manager.setRendererType(renderer);

  return manager;
 }


 /**
  * Message properties 설정
  *
  * <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
  *  <property name="basenames">
  *   <list>
  *    <value>properties.messages</value>
  *   </list>
  *  </property>
  * </bean>
  */
 @Bean public MessageSource messageSource(){
    ReloadableResourceBundleMessageSource messageSource=new ReloadableResourceBundleMessageSource();
    messageSource.setBasenames(
      "classpath:properties/messages"
   );
    return messageSource;
  }

}

저는 ebMvcConfigurerAdapter 를 상속 받아 사용하였습니다.

또는 WebMvcConfigurer 인터페이스를 구현하여 사용하여도 됩니다.

 

각 메소드 또는 Annotation 상단에 주석으로 해 놓은 부분이 XML에 설정하는 내용들입니다.

저도 설정을 해 보면서 XML 과 별반 다를게 없다는 생각을 많이 하였습다..ㅡㅡ;;;

XML에서 에서 Bean에 설정되어 있는 내용을 하나의 메소드로 만들고 해당 메소드에서 XML Bean class 속성에 있는 Class를 선언하고 Return하는 그런 방식입니다..ㅋ

보시는 바와 같이 @Override를 하지 않고 생성한 Method들은 모두 @Bean을 사용하여 Bean에 등록을 합니다.

이렇게 간단히 설명을 하고 넘어가도록 하겠습니다....^^

 

WebInitializer.java 파일은 web.xml 파일을 대체하는 파일입니다.

기본적으로 사용하는 web.xml을 먼저 설명 후 현재 사용하고 있는 내용을 설명합니다.


WebInitializer.java

 

전체코드

package com.intercast.web.initializer;

import java.util.EnumSet;

import javax.servlet.DispatcherType;
import javax.servlet.FilterRegistration;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.filter.DelegatingFilterProxy;
import org.springframework.web.servlet.DispatcherServlet;

import com.intercast.web.config.RootConfig;
import com.intercast.web.config.WebMVCConfig;

public class WebInitializer implements WebApplicationInitializer {

    private static final String CONFIG_LOCATION = "com.intercast.web.config";
    private static final String MAPPING_URL = "/";

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {

        registerDispatcherServlet(servletContext);
        registerCharacterEncodingFilter(servletContext);

    }

    private void registerCharacterEncodingFilter(ServletContext servletContext) {
        FilterRegistration.Dynamic characterEncodingFilter = servletContext.addFilter("characterEncodingFilter", new CharacterEncodingFilter());
        characterEncodingFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
        characterEncodingFilter.setInitParameter("encoding", "UTF-8");
        characterEncodingFilter.setInitParameter("forceEncoding", "true");
    }

    private void registerDispatcherServlet(ServletContext servletContext) {
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        context.setDisplayName("Intercast");
        context.setConfigLocation(CONFIG_LOCATION);
        servletContext.addListener(new ContextLoaderListener(rootContext));

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(context));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping(MAPPING_URL);
    }

}


위의 소스를 보면 빠르신 분들은 우리가 보통 사용하는 web.xml을 어떻게 사용하였는지 대략 이해는 가실겁니다.

XML과 비교하여 보면

 

EncodingFilter 설정입니다.

<filter>
        <filter-name>CharacterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

private void registerCharacterEncodingFilter(ServletContext servletContext) {
        FilterRegistration.Dynamic characterEncodingFilter = servletContext.addFilter("characterEncodingFilter", new CharacterEncodingFilter());
        characterEncodingFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
        characterEncodingFilter.setInitParameter("encoding", "UTF-8");
        characterEncodingFilter.setInitParameter("forceEncoding", "true");
    }


 

DispatcherServlet 설정

<servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/config/dispatcher-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

private void registerDispatcherServlet(ServletContext servletContext) {
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        context.setDisplayName("Intercast");
        context.setConfigLocation(CONFIG_LOCATION);
        servletContext.addListener(new ContextLoaderListener(rootContext));

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(context));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping(MAPPING_URL);
    }

주의 깊게 볼것은 "context.setConfigLocation(CONFIG_LOCATION);" 부분인데 해당 부분에 Config 설정 파일이 있다고 알려 주게 됩니다.

그러면 해당 파일들을 확인하여 자동 설정으로 들어가게 되죠..^^

별도의 설명이 없어도 소스를 보면 이해가 가실거라 생각하여 설명하진 않도록 하겠습니다.


하지만 JavaConfig 설에서 보면 SpringSecurityFilterChain 설정이 빠져 있습니다.

이유인 즉슨 나중에 설명을 드리겠지만 해당 파일에서 설정하는 것이 아니라

AbstractSecurityWebApplicationInitializer.java

파일을 확장해 주므로 주므로 해당 FilterChain 설정은 끝나게 됩니다.


하지만 저 같은 경우 Custom Taglib를 사용해야 하는데 아직 web.xml에서 <jsp-config> 설정하는 방법을 찾지 못하여 WebInitializer.java 파일은 사용하지 못하고 web.xml을 사용하고 있습니다.

Tomcat 8 부터는 가능한듯한데 Tomcat 7에서는 아직 찾지를 못하였습니다.

아래는 Tocmat 8 에서 작동한다는 소스 부분코드 입니다.

JspConfigDescriptor j = new JspConfigDescriptor()
   
{

       
@Override
       
public Collection<TaglibDescriptor> getTaglibs()
       
{
           
// TODO Auto-generated method stub
           
return null;
       
}

       
@Override
       
public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups()
       
{
           
Collection<JspPropertyGroupDescriptor> c = new ArrayList<JspPropertyGroupDescriptor>();
           
JspPropertyGroupDescriptorImpl pgDescriptor = new JspPropertyGroupDescriptorImpl();
            pgDescriptor
.setIsXml(Boolean.TRUE.toString());
            pgDescriptor
.getUrlPattern().add("/js/generated/*");
            pgDescriptor
.setElIgnored(Boolean.FALSE.toString());
            pgDescriptor
.setPageEncoding("UTF-8");
            c
.add(pgDescriptor);
           
return null;
       
}
   
};
    servletContext
.setJspConfigDescriptor(j);

위의 코드를 보면 servletContext.setJspConfigDescriptor(j); 라는 메소드가 있는데 저 메소드가 Tomcat7에는 없고 Tomcat 8에만 있습니다..ㅡㅜ

 

그래서 결론적으로 내가 사용하는 web.xml은

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xml="http://www.w3.org/XML/1998/namespace"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">

 <context-param>
      <param-name>contextClass</param-name>
      <param-value>
          org.springframework.web.context.support.AnnotationConfigWebApplicationContext
      </param-value>
  </context-param>

  <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>com.intercast.web.config.AppConfig</param-value>
  </context-param>

  <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

 <servlet>
  <servlet-name>appServlet</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
   <param-name>contextClass</param-name>
   <param-value> org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>appServlet</servlet-name>
  <url-pattern>*.htm</url-pattern>
 </servlet-mapping>

 <filter>
  <filter-name>CharacterEncodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>CharacterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

 <jsp-config>
  <taglib>
   <taglib-uri>/WEB-INF/tags/menu</taglib-uri>
   <taglib-location>/WEB-INF/tags/menu.tld</taglib-location>
  </taglib>
  <taglib>
   <taglib-uri>/WEB-INF/tags/cf</taglib-uri>
   <taglib-location>/WEB-INF/tags/cf.tld</taglib-location>
  </taglib>
 </jsp-config>

</web-app>

기존 web.xml과 비슷할 겁니다.

하지만 붉은 색으로 된 부분이 기존 web.xml에 없었던 부분이죠.

org.springframework.web.context.support.AnnotationConfigWebApplicationContext 를 사용하여

contextConfigLocation으로 설정된 해당 소스를 호출하여 Config를 설정하는 듯합니다..ㅡㅡ

더 분석을 해봐야 할듯합니다..ㅋㅋㅋ

 

혹시나 Tomcat 7에서도 Custom Taglib를 사용할 수 있으신 분은 답글 남겨주시면 감사하겠습니다...^^

그럼 다음으로~~~~~

pom.xml 파일


사용중인 버전

<properties>
        <spring.maven.artifact.version>4.1.6.RELEASE</spring.maven.artifact.version>
        <org.apache.tiles.version>3.0.1</org.apache.tiles.version>
        <org.mybatis-version>3.2.8</org.mybatis-version>
        <org.mybatis.spring-version>1.2.2</org.mybatis.spring-version>
        <org.springframework.security-version>4.0.0.RELEASE</org.springframework.security-version>
    </properties>


Repositories

<repositories>
        <repository>
            <id>mvn2</id>
            <url>http://repo1.maven.org/maven2/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>egovframe</id>
            <url>http://www.egovframe.go.kr/maven/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>jasterxml</id>
            <url>http://repo1.maven.org/maven2/com/fasterxml/jackson/</url>
        </repository>
    </repositories>


Dependencies

<dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.maven.artifact.version}</version>
        </dependency>

        <!-- Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-aspects</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${org.springframework.security-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <!-- eGov -->
        <dependency>
            <groupId>egovframework.rte</groupId>
            <artifactId>egovframework.rte.ptl.mvc</artifactId>
            <version>2.0.0</version>
        </dependency>


        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${org.mybatis-version}</version>
        </dependency>

        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>${org.mybatis.spring-version}</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.3alpha-8</version>
        </dependency>

        <!-- Servlet dependencies -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!-- Tiles -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.5.8</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.8</version>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.1.0.Final</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-base</artifactId>
            <version>2.5.2</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>


        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-api</artifactId>
            <version>${org.apache.tiles.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>${org.apache.tiles.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.1</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.9.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.4</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.1.3.Final</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc5</artifactId>
            <version>11.2.0.3</version>
        </dependency>

    </dependencies>


+ Recent posts