Spring2012. 4. 20. 13:48
  1. 목표
    Spring Framework 에서 꼭 필요한 Library와 설정 을 알아본다.

  2. 학습
    기본적으로 Spring framework를 사용하기 위해서 필요한, 기본 셋팅 정보
  • JDK 1.6
  • eclipse
  • spring framwork
  • commons-logging - Spring framework 에서 필수로 필요함
  • jakarta-taglibs-standard Spring-MVC 에서 필수로 필요함


web.xml 설정

<!-- Filter Setting -->

 <filter>

<filter-name>encodingFilter</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>encodingFilter</filter-name>

<url-pattern>*.do</url-pattern>

</filter-mapping>

<!-- Filter Setting -->

<!-- Spring Config Setting -->

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/config/*-context.xml

</param-value>

</context-param>

     <!-- Spring Config Setting -->

<!-- listener Register -->

<listener>

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

</listener>

<!-- listener Register -->

<!-- Spring-MVC Config Setting -->

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<init-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/config/spring-servlet.xml

</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>

<!-- Spring-MVC Config Setting -->


application-context.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.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">


<!-- component scan -->

<context:component-scan base-package="kr.pe.lahuman" >

<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>

</context:component-scan>

<!-- component scan -->


</beans>


spring-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:context="http://www.springframework.org/schema/context"

xmlns:p="http://www.springframework.org/schema/p"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">


<!-- component scan -->

<context:component-scan base-package="kr.pe.lahuman"

use-default-filters="false">

<context:include-filter type="annotation"

expression="org.springframework.stereotype.Controller" />

</context:component-scan>

<!-- component scan -->


   <!--

        - This bean configures the 'prefix' and 'suffix' properties of 

        - InternalResourceViewResolver, which resolves logical view names 

        - returned by Controllers. For example, a logical view name of "vets" 

        - will be mapped to "/jsp/vets.jsp".

    -->

<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver"

p:order="1" p:viewClass="org.springframework.web.servlet.view.JstlView"

p:prefix="/jsp/" p:suffix=".jsp" />

</beans>


TestDao.java

@Repository

public class TestDao {


public String getData(String str){

return str;

}

}


TestServiceImpl.java

@Service

public class TestServiceImpl implements TestService {


@Autowired

private TestDao testDao;

@Override

public String getData(String str) {

return testDao.getData(str);

}

}


TestController.java

@Controller

public class TestController {


@Autowired

private TestService testService; 

@RequestMapping(value="/test.do")

public String testView(){

return testService.getData("test");

}

}



첨부파일 참조


SpringWeb.zip


Posted by lahuman
CSS/HTML2011. 9. 28. 10:58

해외 무료이미지 사이트
www.blog.spoongraphics.co.uk : 회원가입 없이 디자인소스 다운로드 가능
http://www.morguefile.com   :회원 가입 없이 사용 가능
www.photoxpress.com  : 회원 가입 후, 무료 포토 이용 가능
http://www.pixiv.net : 일본 서비스, iphone에서도 무료이용 가능
http://www.photopy.com : 무료 포토 제공
www.bittbox.com : freebies 메뉴를 통해 무료이용 가능
http://www.sxc.hu  :회원 가입 후, 무료 포토 가능
http://www.templatemo.com : 무료 웹템플릿, 플래시 제공
www.vectorvault.com : 매일 새로운 벡터 이미지 제공 
Posted by lahuman
Tool-설정및사용2010. 9. 28. 11:58
down url : 


내 위치 검색 url : 

아직 무료이고(20100928 기준) 괜찮은듯!


Posted by lahuman