블로그 이미지
올해목표 // 10월 어학연수 떠나자~ 자수씨

카테고리

전체글 (1457)
Brand New! (28)
주절주절 (213)
MOT (11)
해외쇼핑 (49)
쇼핑노트 (150)
취미생활 (94)
iPhone (4)
Eclipse (121)
Google (83)
Spring (31)
JAVA (176)
JavaScript (59)
WEB (49)
Database (20)
OS (26)
Tools (8)
Tips (26)
IT정보 (1)
Book (21)
Programming (37)
외부행사 (43)
주변인들 (17)
여행노트 (60)
학교생활 (30)
회사생활 (52)
사회생활 (5)
외국어공부 (12)
잡동사니 (30)
Total
Today
Yesterday
 
05-04 00:00
 

달력

« » 2024.5
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
 

최근에 올라온 글

최근에 달린 댓글



Spring Roo~ 작년에 봤을 때는 듣보잡처럼 보였는데, 지금 보니깐 감동의 물결이 넘실거립니다.

설치에 대해서는 튜토리얼을 보면 되기 때문에 나중에 정리할 여유가 생기면 하기로 하고... 지금은 설치가 된 상태를 가정하여 작성합니다.

구동 환경
Spring Roo 1.1.4 RELEASE
Maven 2.2.1.RELEASE
STS 2.7.0 RELEASE (필수는 아님)


새로운 프로젝트 디렉토리를 생성하고 roo shell 을 실행시킵니다.
# mkdir RentShop
# cd RentShop
# roo

roo>



프로젝트를 생성합니다. 프로젝트 생성 시에는 최상위 패키지를 지정해야 합니다.
roo> project --topLevelPackage kr.co.vicki.roo.sample.rentshop


퍼시스턴스 레이어를 설정합니다. 프로바이더는 하이버네이트로, 데이터베이스는 테스트 용이므로 메모리 DB를 사용합니다.
roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY


엔티티 클래스를 생성합니다. Car, Customer, Rent
roo> entity --class ~.domain.Car --testAutomatically
roo> field string --fieldName modelName --notNull
roo> field number --fieldName displacement --type java.lang.Integer --notNull 0
roo> entity --class ~.domain.Customer --testAutomatically
roo> field string --fieldName name --notNull
roo> entity --class ~.domain.Rent --testAutomatically
roo> field reference --fieldName car --type ~.domain.Car --notNull
roo> field number --fieldName period --type java.lang.Integer --notNull 0


컨트롤러를 생성합니다. 패키지를 지정가능합니다. 위에 엔티티 생성시에도 나왔던 '~' 는 프로젝트 생성 시 지정했던 topLevelPackage 를 의미합니다.
roo> controller all --package ~.web



이걸로 간단한 샘플 프로젝트는 끝이 났습니다. 톰캣을 띄워 확인합니다.
# mvn tomcat:run

....
2011. 7. 13 오전 1:03:51 org.apache.catalina.startup.Embedded start
정보: Starting tomcat server
2011. 7. 13 오전 1:03:51 org.apache.catalina.core.StandardEngine start
정보: Starting Servlet Engine: Apache Tomcat/6.0.29
2011. 7. 13 오전 1:03:51 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring root WebApplicationContext
2011. 7. 13 오전 1:03:53 org.apache.catalina.core.ApplicationContext log
정보: Initializing Spring FrameworkServlet 'RentShop'
2011. 7. 13 오전 1:03:53 org.apache.coyote.http11.Http11Protocol init
정보: Initializing Coyote HTTP/1.1 on http-8080
2011. 7. 13 오전 1:03:53 org.apache.coyote.http11.Http11Protocol start
정보: Starting Coyote HTTP/1.1 on http-8080



위에 보이는 컨텍스트를 확인하여 생성된 프로젝트에 접속을 합니다.
http://localhost:8080/RentShop





먼가 투박해보이기는 하지만 CRUD 페이지가 뚝딱 만들어졌습니다.

아직 진가를 보여주기에는 부족해보이지만 실제로 Spring Roo 를 어딘가에 적용할지를 생각한다면... WOW 입니다~


Posted by 자수씨
, |

글 보관함

최근에 받은 트랙백