참조 :
자주 쓰는 구문 템플릿(Templates)으로 등록하기

추가할 탬플릿은 Spring 에서 bean 설정 파일로 사용 할 때 기본적으로 사용하는 구문입니다. 보통은 예전 프로젝트에서 복사하거나 레퍼런스에서 복사해서 사용을 하지만 지난번 Epril 세미나에서 토비님께서 라이브 코딩 하실 때 사용하시는 걸 보고 '나도 등록해야겠다.' 해놓고 이제서야 등록하게 됐습니다. :)

Eclipse 를 키고 -> preference -> Web and XML -> XML Files -> XML Templates 에서 new 버튼을 사용하여 등록합니다.

등록할 탬플릿은 두 개

1. 일반 Spring 설정 파일 :: spring(normal)

<?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:util="http://www.springframework.org/schema/util"
       xmlns:p="http://www.springframework.org/schema/p"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
    ${cursor}
</beans>

2. Schema based Spring AOP와 Transaction용 :: spinrg(advanced)

<?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:util="http://www.springframework.org/schema/util"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
default-autowire="byName">
   
</beans>

설정 내용을 보시면 아시겠지만 p 와 util name 스페이스를 사용할 수 있으며 byName으로 autowiring을 사용합니다.

s만 입력한 뒤 자동완성 단축키(컨트롤+스페이스)를 클릭하면 다음과 같이 간단하게 사용할 수 있습니다. 이제 더이상 레퍼런스와 다른 프로젝트를 뒤질 필요가 없어졌습니다. 나이수..

사용자 삽입 이미지
사용자 삽입 이미지
자신이 등록한 탬플릿을 xml 형식으로 공유할 수 있습니다. 아래 그림에 보이는 import 버튼을 사용하여 다운받은 xml 파일을 불러 들이면 됩니다.
사용자 삽입 이미지cl180.xmldl157.xml