티스토리 툴바



2011/11/09 16:47

Charset, Encoding 이해하기 (링크)

http://blog.naver.com/blubeard/80090746102
Trackback 0 Comment 0
2011/11/04 19:23

ibatis에서 서로 다른 sqlmap.xml 파일 간 참조 ID로 접근해야 될 경우 고려사항


로컬 윈도우 환경에서는 잘 돌아가는 녀석이, 서버(리눅스) 에만 올리면 "There is no result map named" 에러가 발생한다. 

구글신에게 물어봐도 답을 찾지 못했다. 결국 금요일 퇴근도 못하고 삽질 3시간 후 해결 .... ㅠㅠ

AAAA-sqlmap.xml

<sqlMap namespace="_AAAA">


    ....


    <resultMap id="myMapId" class="XXXX">

    ....

    </resultMap>


    ....


</sqlMap>

 
BBBB-sqlmap.xml

<sqlMap namespace="_BBBB">


    ....


    <select id="list" resultMap="_AAAA.myMapId" parameterClass="XXXX">

    ....

    </select>


    ....


</sqlMap>


이렇게 사용해야 될 경우에는 sqlmap 파일의 로딩순서에 유의해야 한다.

sqlmap-config.xml 파일에 수동으로 기능별 sqlmap 파일을 선언해 줄 경우에는 아래와 같이 AAAA-sqlmap.xml을 먼저 선언해줘야 한다.

<sqlMapConfig> 

    ....

    <settings enhancementEnabled="true" useStatementNamespaces="true"/> 

    <sqlMap resource="com/foo/AAAA-sqlmap.xml" /> 

    <sqlMap resource="com/foo/BBBB-sqlmap.xml" /> 

    ....

</sqlMapConfig> 



만약 스프링과 연동하여 sqlmap 파일을 자동으로 로딩해서 사용하고 있을 경우에는 아래와 같이 해주도록 한다.

<bean id="sqlMapClient"

    class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">

    ....

    <property name="mappingLocations">

        <list>

            <value>classpath*:/com/foo/AAAA-sqlmap.xml</value>

            <value>classpath*:/com/foo/BBBB-sqlmap.xml</value>

            <value>classpath*:/com/others/**/*-sqlmap.xml</value>

        </list>

    </property>

    ....

</bean>




Trackback 0 Comment 0
2011/10/25 16:29

오라클 JDBC 드라이버 버전별 호환성 정보

Which JDBC drivers support which versions of Oracle Database?
  • JDBC 9.0.1 drivers can talk to RDBMS
    • 11.1.0
    • 10.2.0
    • 10.1.0
    • 9.2.0
    • 9.0.1
    • 8.1.7
    • 8.1.6
    • 8.1.5
    • 8.0.6
    • 8.0.5
    • 8.0.4
    • 7.3.4
  • JDBC 9.2.0 drivers can talk to RDBMS
    • 11.2.0
    • 11.1.0
    • 10.2.0
    • 10.1.0
    • 9.2.0
    • 9.0.1
    • 8.1.7
  • JDBC 10.1.0 drivers can talk to RDBMS
    • 11.2.0
    • 11.1.0
    • 10.2.0
    • 10.1.0
    • 9.2.0
    • 9.0.1
    • 8.1.7
  • JDBC 10.2.0 drivers can talk to RDBMS
    • 11.2.0
    • 11.1.0
    • 10.2.0
    • 10.1.0
    • 9.2.0
    • 9.0.1
    • 8.1.7
  • JDBC 11.1.0 drivers can talk to RDBMS
    • 11.2.0
    • 11.1.0
    • 10.2.0
    • 10.1.0
    • 9.2.0
    • 9.0.1
  • JDBC 11.2.0 drivers can talk to RDBMS
Trackback 0 Comment 0
2011/09/08 20:31

SpringMVC @PathVariable 주의사항


아래의 코드에 따라 ....

@RequestMapping(value="/club/{seq}")

public String clubFrame(@PathVariable("seq") Integer seq) {

    return "/club/ER_index";

}

 
주소창에 /club/3 을 입력하면 NoSuchRequestHandlingMethodException 예외가 발생하는 경우가 있다.

참고로 web.xml에는  

<servlet-mapping>

    <servlet-name>dispatcher</servlet-name>

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

</servlet-mapping>

<servlet-mapping>

    <servlet-name>dispatcher</servlet-name>

    <url-pattern>/club/*</url-pattern>

</servlet-mapping>

 와 같이 설정되어 있다.

해결책은 아래와 같다.

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">

    <property name="alwaysUseFullPath" value="true" />

    ....

</bean>

<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">

    <property name="alwaysUseFullPath" value="true" />

    ....

</bean>

 
Trackback 0 Comment 0
2011/07/23 20:55

톰캣 6에서 컨텍스트 간 세션공유 (Cross context session sharing in Tomcat)

톰캣 설정
context-1.xml
<Context crossContext="true" .... 생략

context-2.xml 
<Context crossContext="true" .... 생략

테스트
context-1.jsp 

<%

    ServletContext ctx = application.getContext("/context-1");

    Integer counter = (Integer)ctx.getAttribute("counter");

    if (counter == null) {

        counter = 0;

    }

    counter++;

    

    request.setAttribute("counter", counter);

    ctx.setAttribute("counter", counter);

%>


<h1>Context-1</h1>

<h1>현재 카운터는 ${counter}입니다.</h1>


context-2.jsp

<%

    ServletContext ctx = application.getContext("/context-1");

    Integer counter = (Integer)ctx.getAttribute("counter");

    if (counter == null) {

        counter = 0;

    }

    counter++;

    

    request.setAttribute("counter", counter);

    ctx.setAttribute("counter", counter);

%>


<h1>Context-1</h1>

<h1>현재 카운터는 ${counter}입니다.</h1>


출처 : http://jee-bpel-soa.blogspot.com/2009/06/session-sharing-in-apache-tomcat.html
 

 
Trackback 0 Comment 0