달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31


eclipse 의 maven 플러그인을 업그레이드하거나 STS 를 업그레이드하면 m2e 플러그인이 1.0을 사용하게 된다.
이 경우 기존 환경과 다른 부분이 많아 오류가 발생하는 부분이 있다.
위처럼 프로젝트별로 maven builder 오류가 발생하면 해당 프로젝트의 .project 파일을 직접 수정하도록 한다.

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>news-telematics-service</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
... 중략
        <buildCommand>
            <name>org.eclipse.m2e.core.maven2Builder</name>
            <arguments>
            </arguments>
        </buildCommand>
... 중략
    </buildSpec>
    <natures>
... 중략
        <nature>org.eclipse.m2e.core.maven2Nature</nature>
... 중략
    </natures>
</projectDescription>


Posted by fromm0
|
SpringJDBC를 사용할때, PreparedStatement 의 파라미터를 로그에 찍기 위해서는 로그레벨을 TRACE로 해야 한다.

<logger name="org.springframework.jdbc.core" additivity="false">
    <level value="TRACE" />
    <appender-ref ref="console" />
</logger>

Posted by fromm0
|

[알림] 도메인 변경

일상 2011. 9. 18. 17:16
기존에 제가 사용하는 도메인이 openframework.or.kr 인데요.
도메인을 블로그나 위키에서 사용하는 기본 도메인을 변경할까 합니다.
도메인의 의미는 명확한 편이나 너무 길어서 기억하기 쉽지 않네요.

기존 도메인인 openframework.or.kr 도 계속 사용하겠지만 기본 도메인은 개인 도메인인 ldg.pe.kr 을 사용합니다.

그래서 위키는 http://ldg.pe.kr 입니다.
블로그는 http://blog.ldg.pe.kr 입니다.
Posted by fromm0
|
웹사이트에 업로드 요청했는데, 휴가 갔다 왔나봅니다.
오늘에서야 답변이..~~~
다음주 쯤에나 업로드 되려나..


http://groups.google.com/group/mybatis-user/browse_thread/thread/b084c532c18f7f89/07c699f9ce7d618e?lnk=gst&q=korean#07c699f9ce7d618e


Posted by fromm0
|
MyBatis 3.0 의 사용자 가이드 한국어 문서를 공개합니다.
ㅋㅋ.. 거창하네요..

MyBatis-3-User-Guide_ko.pdf
다시 보면, 조금 수정할게 있긴 하지만 내용 파악에 어려움은 없어보입니다.
오타및 오역, 개선은 댓글로 남겨주세요. ^^

마이바티스 홈페이지에 웹페이지 형태로도 보실수 있습니다. 아래 URL참고


Posted by fromm0
|
1. web.xml 설정
<error-page>
    <error-code>404</error-code>
    <location>/html/error/notFound.html</location>
</error-page>    
<error-page>
    <error-code>500</error-code>
    <location>/error/system.mvc</location>
</error-page>

여기서 404에 해당되는 notFound.html 파일은 정적인 단순 html 파일입니다.
하지만 500에 해당되는 system.mvc 를 SpringMVC 를 사용하는 동적 페이지입니다.

2. servlet.xml 설정
<mvc:view-controller path="/error/system.mvc" view-name="/error/temporarySystemError"/>

/error/system.mvc 에 대해 view-name 은 /error/temporarySystemError 로 정했습니다.

3. decorators.xml 설정
<decorator name="error" page="pageDecorator_error.jsp">
    <pattern>/error/system.mvc</pattern>
</decorator>

/error/system.mvc 로 요청이 오면 pageDecorator_error.jsp 페이지의 데코레이터가 먹도록 설정을 했습니다.

4. pageDecorator_error.jsp 파일
... 중략

<body>

    <page:applyDecorator name="header"/>
    <decorator:body/>

</body>
</html>

page 태그의 applyDecorator 가 먹을 줄 알았는데, 이상하게 먹지 않더군요.
근데 특이한 건 에러 페이지가 아닌 직접 /error/system.mvc 형태로 접속하면 정상적으로 데이터레이터가 먹는 것이었습니다.

5. temporarySystemError.jsp 파일
<div>
어쩌고 저쩌고
<div>


해결방법은 decorators.xml 파일의 url-pattern 을 사용하지 않고 결과 jsp에 decorator 를 직접 적용하는 것이었습니다. 즉 결과 페이지인 temporarySystemError.jsp 파일을 아래처럼 수정한 것이죠.

... 중략

<body>

    <page:applyDecorator name="header"/>
    <div>
    어쩌고 저쩌고
    <div>

</body>
</html>


http://www.java2go.net/blog/205?TSSESSION=1f8421104a0d5b693e30aaea745da9d6 이 글이 도움이 많이 되었습니다.








Posted by fromm0
|


jprofiler 의 라이센스가 5.x 대라, 5.x 버전의 최신인 5.2.4를 사용하고 있다.
스냅샷 저장 및 열기 기능은 그닥 많이 사용하지는 않지만, 내부 리포트를 작성하기 위해서는 필수로 사용하게 되는 기능인데 에러가 발생한다.
분명 5.2.4 버전에서 스냅샷을 생성하고, 그 파일을 읽어들이는데도 에러가 발생해서 ej-technologies 에 메일을 보냈다. 언제 답변이 올런지..

'일상' 카테고리의 다른 글

[번역] VisualVM 한글문서 등록요청  (0) 2013.02.27
[알림] 도메인 변경  (2) 2011.09.18
[MyBatis] 3.0 개발자 가이드 번역 중..  (0) 2011.07.30
[중국북경출장] 음식이야기  (2) 2010.07.13
[중국북경출장] 교통편  (0) 2010.07.13
Posted by fromm0
|
번역 중이라.. 아직 올리기는 그렇구요. ^^
ibatis 를 이제 버릴까 해서.. hibernate 를 고려했다가 다들 어려워해서 현실적으로 MyBatis 를 다시 보고 있습니다.
번역 완료되면 예전처럼 공식 페이지에 업로드 요청 할 꺼구요..
요즘에도 많이 사용하나 모르겠네요. ^^
Posted by fromm0
|
1. XML 데이터
<PARENT>
    <HEAD>
        <RESULT_CODE>00001</RESULT_CODE>
        <RESULT_MESSAGE>success</RESULT_MESSAGE>
    </HEAD>
    <BODY>
        <STATUS>true</STATUS>
    </BODY>
</PARENT>

2. Bean 설정
<bean id="unmarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller">
    <property name="aliases">
        <props>
            <prop key="PARENT">kr.or.openframework.model.Parent</prop>
        </props>
    </property>
    <property name="autodetectAnnotations" value="true" />
</bean>

3. Repository 소스
@Repository
public class ParentRepository {
    @Resource(name = "unmarshaller")
    private Unmarshaller unmarshaller;
   
    public Object xmlToObject(URL url) {
        InputStream urlInputStream = null;
        try {
            urlInputStream = url.openConnection().getInputStream();
            return unmarshaller.unmarshal(new StreamSource(urlInputStream));
        } catch (IOException e) {
        } finally {
            if (urlInputStream != null) {
                try {
                    urlInputStream.close();
                } catch (IOException e) {
                }
            }
        }
    }
}

4. 모델 클래스
package kr.or.openframework.model;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias("PARENT")
public class Parent {
    @XStreamAlias("HEAD")
    private Head head;
    @XStreamAlias("BODY")
    private Body body;

    public Head getHead() {
        return head;
    }

    public void setHead(Head head) {
        this.head = head;
    }

    public Body getBody() {
        return body;
    }

    public void setBody(Body body) {
        this.body = body;
    }
}

@XStreamAlias("HEAD")
class Head extends BaseModel {
    @XStreamAlias("RESULT_CODE")
    private String resultCode;
    @XStreamAlias("RESULT_MESSAGE")
    private String resultMessage;

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMessage() {
        return resultMessage;
    }

    public void setResultMessage(String resultMessage) {
        this.resultMessage = resultMessage;
    }
}
@XStreamAlias("BODY")
class Body {
    @XStreamAlias("STATUS")
    private String status;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status= status;
    }
}

5. 결과 출력
kr.or.openframework.model.Parent@e72f0c[
  head=kr.or.openframework.model.Head@12eabae[ 
  resultCode=00001
  resultMessage=success
]
  body=kr.or.openframework.model.Body@10948cf[
  status=true
]
]


Posted by fromm0
|

[maven] javadoc 생성

자바 2011. 2. 15. 13:03
@ pom.xml 설정
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<stylesheetfile>openframework.css</stylesheetfile>
<aggregate>true</aggregate>
<minmemory>128m</minmemory>
<maxmemory>256m</maxmemory>
<breakiterator>true</breakiterator>
<quiet>false</quiet>
<source>1.6</source>
<verbose>true</verbose>
<linksource>true</linksource>
<outputDirectory>${project.build.directory}/javadoc</outputDirectory>
<reportOutputDirectory>${project.build.directory}/javadoc</reportOutputDirectory>
<destDir>api</destDir>
<locale>ko_KR</locale>
<encoding>UTF-8</encoding>
<charset>UTF-8</charset>
<docencoding>UTF-8</docencoding>
</configuration>
</plugin>
</plugins>
</reporting>

@ maven goal
javadoc:javadoc

@ 참고 URL
Posted by fromm0
|