BLOG NOTICE TAG CLOUD GUESTBOOK
RSS
CATEGORY

0
Comments

0
Trackbacks
my.ini 설정파일
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

mysql 5.0 이전 버전까지 주석
mysql 5.x 이후 버전부터 활성

수치타입은 숫자형으로 문자타입은 문자형으로 넣어 주는 습관을 갖자.
한 예로 체크박스/라디오를 사용할때 선택/체크를 하면 특정값을 넘기고 하지 않고 넘기면 ""로 넘어간다는 사실을 알아야 한다.
이때, 문자타입의 경우는 별 문제가 되지 않겠지만, 수치타입일 경우 이와 같은 에러가 발생한다.
2008/03/03 02:14 2008/03/03 02:14
TAG
0
Comments

0
Trackbacks
nv_en.properties
nv.title = Title
nv.name = Name
nv.email = Email

nv.about = Home > {0} > {1}
...


nv_ko.properties
nv.title = 제목
nv.name = 이름
nv.email = 이메일

nv.about = 홈 > {0} > {1}
...


sample.jsp
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"  %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<fmt:setLocale value="ko" />
<fmt:setBundle var="nvBundle" basename="nv" scope="request" />

nv.title = <fmt:message bundle="${nvBundle}" key="nv.title" />
<br />
<fmt:message bundle="${nvBundle}" key="nv.about">
  <fmt:param>교수진</fmt:param>
  <fmt:param><fmt:message bundle="${nvBundle}" key="${param.menuno}" /></fmt:param>
</fmt:message>


결과

nv.title = 제목
홈 > 교수진 > 전임


참고
nv_ko.properties 의 경우 한글이 깨진다.
JAVA_HOME\bin\native2ascii nv_ko.properties nv_uni.properties  -->  ant로 자동 변환하기
   이렇게 하면 nv_uni.properties 파일이 생성된다.
   이것을 사용하면 한글문제를 해결 할 수 있다.


/WEB-INF/classes/kr/co/alseom/dev/nv.properties 접근
<fmt:setBundle var="nvBundle" basename="kr.co.alseom.dev.nv" scope="request" />
   basename는 nv.properties 이름을 말하고 패키지명 접근 방식으로 하면 됨

2008/02/22 10:09 2008/02/22 10:09
0
Comments

0
Trackbacks
기본적인 DWR 사용 설정은 흰둥이님 강좌를 참조 : http://cafe.naver.com/javalove/1588

dwr.xml

<dwr>
  <allow>

    <!-- Ad -->
    <create creator="spring" javascript="AdService">
      <param name="beanName" value="adService" />
    </create>
    <convert converter="bean" match="ad.domain.AdCost" />
   
    <!-- Code -->
    <create creator="spring" javascript="CodeService">
      <param name="beanName" value="codeService" />
    </create>
    <convert converter="bean" match="product.domain.Code" />
   
  </allow>
</dwr>


MyAppContext.xml

<beans>
  <bean id="adService" class="ad.service.AdServiceImpl">
    <property name="adDAO" ref="adDAO" />
  </bean>

  <bean id="codeService" class="product.service.CodeServiceImpl">
    <property name="codeDAO" ref="codeDAO" />
    <property name="productDAO" ref="productDAO" />
  </bean>
</beans>



wex.xml

<context-param>
  <param-name>spring-context</param-name>
    <param-value>/WEB-INF/context/MyAppContext.xml</param-value>
  </context-param>

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

2008/02/19 23:54 2008/02/19 23:54
TAG ,
0
Comments

0
Trackbacks
출처 : http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information

Mysql
<insert id="insertFolder" parameterClass="member">
  INSERT INTO folder (parent_id, owner, foldername)
  VALUES (#parentId#, #owner#, #foldername#)
  <selectKey resultClass="int" keyProperty="id">
    SELECT LAST_INSERT_ID() AS id
  </selectKey>
</insert>

: keyProperty을 입력 하면 member 클래스의 id 값에 자동 입력 된다.



Oracle

<insert id="insert" parameterClass="customer">
  <selectKey resultClass="int" keyProperty="id">
    select someSequence.NEXTVAL as "id" from dual
  </selectKey>
  insert into Customer (id, name)
  values (#id#, #name#)
</insert>

<insert id="insert2" parameterClass="Entity" parameterMap="insert-paramMap">
   <selectKey resultClass="int" keyProperty="pkey"> SELECT seq.nextval FROM DUAL </selectKey>
   INSERT INTO EntityTable (PKEY, DATA) VALUES (?, ?)
</insert>

2008/02/18 12:49 2008/02/18 12:49
0
Comments

0
Trackbacks
2008/02/15 15:18 2008/02/15 15:18