달력

3

« 2024/3 »

  • 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 MVC는 Spring Framework중에서 웹 개발을 쉽게 할 수 있도록 도와준다.
국내에서 출판된 책들은 Source를 제공하기는 하지만, 책을 보고 Source를 실행하려고 하면 잘 동작하지 않는다. 물론 손으로 직접 쳐서 입력할때 오타가 있기는 하지만, 서버의 설정과 환경 구성에 대해서 충분하게 설명해 주지 못하기 때문이다.

이를 위해, www.springframework.org에서는 제공하고 있는 Spring MVC를 위해서, Developing a Spring Framework MVC application step-by-step
라는 제목으로 Spring MVC개발에 대해 설명하고 있다. 2003년에 작성된 것과 올 2008년에 작성된 것이 있다.

예제는 초보자를 위해서, 개발 환경 설정과, Ant의 Build.xml 만들기와 사용법등을 부과적으로 설명하고 있다. Ant를 사용하는 법도 부과적으로 얻을 수 있다. 이에 대한 목차는 다음과 같다.(2003년도 작성)

[목차] 
Part 1 – Basic Application and Environment Setup
Part 2 – Developing and Configuring the Application
Part 3 – Adding Unit Tests and a Form to the Application
Part 4 – Implementing Database Persistence

위는 2003년도에 작성된 예제와 Sample이고 tex t위주의 설명으로 되어 있지만,  MVC개발을 위한  설정 XML 파일을 어떻게 작성해야 하는지, 그리고 Dispatcher와 Controller 그리고, View에 대한 코드들에 대해 쉽게 이해할 수 있도록 예제와 더불어 쉽게 설명하고 있다.

그리고, 2008년도에 작성된 Spring MVC step-by-step의 목차는 다음과 같은데, 설명과 함께 캡처한 이미지를 제공하여 설명을 돕고 있다.

[목차]
 

Overview
1. What's covered
2. Prerequisite software
3. The application we are building
1. Basic Application and Environment Setup
1.1. Create the project directory structure
1.2. Create 'index.jsp'
1.3. Deploy the application to Tomcat
1.4. Check the application works
1.5. Download the Spring Framework
1.6. Modify 'web.xml' in the 'WEB-INF' directory
1.7. Copy libraries to 'WEB-INF/lib'
1.8. Create the Controller
1.9. Write a test for the Controller
1.10. Create the View
1.11. Compile and deploy the application
1.12. Try out the application
1.13. Summary
2. Developing and Configuring the Views and the Controller
2.1. Configure JSTL and add JSP header file
2.2. Improve the controller
2.3. Decouple the view from the controller
2.4. Summary
3. Developing the Business Logic
3.1. Review the business case of the Inventory Management System
3.2. Add some classes for business logic
3.3. Summary
4. Developing the Web Interface
4.1. Add reference to business logic in the controller
4.2. Modify the view to display business data and add support for message bundle
4.3. Add some test data to automatically populate some business objects
4.4. Add the message bundle and a 'clean' target to 'build.xml'
4.5. Adding a form
4.6. Adding a form controller
4.7. Summary
5. Implementing Database Persistence
5.1. Create database startup script
5.2. Create table and test data scripts
5.3. Add Ant tasks to run scripts and load test data
5.4. Create a Data Access Object (DAO) implementation for JDBC
5.5. Implement tests for JDBC DAO implementation
5.6. Summary
6. Integrating the Web Application with the Persistence Layer
6.1. Modify service layer
6.2. Fix the failing tests
6.3. Create new application context for service layer configuration
6.4. Add transaction and connection pool configuration to application context
6.5. Final test of the complete application
6.6. Summary
A. Build Scripts


위의 순서대로 예제를 실행해 보았는데, 어렵지 않게 스프링 MVC에 대해 이해할 수 있었고, 개발시 환경 구성과 설정방법들에 배울 수 있었다.



:
Posted by 행복상자