Archive for the ‘ Struts ’ Category

Apache Struts

Apache Struts is a free open-source framework for creating Java web applications.

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

The framework provides three key components:

  • A “request” handler provided by the application developer that is mapped to a standard URI.
  • A “response” handler that transfers control to another resource which completes the response.
  • A tag library that helps developers create interactive form-based applications with server pages.

The framework’s architecture and tags are buzzword compliant. Struts works well with conventional REST applications and with nouveau technologies like SOAP and AJAX.

출처 – http://struts.apache.org/

- 스트럿츠는 MVC 아키텍처를 활용한 웹 애플리케이션 개발을 돕도록 디자인 되어져 있다.

- 스트럿츠는 REST 애플리케이션, SOAP, AJAX와 잘 동작한다.

Struts 환경 설정

Struts 환경 설정

http://www.apache.org

에서 아래의 Library 와 documents 압축 파일을 받는다.

http://mirror.khlug.org/apache/struts/library/struts-1.3.10-lib.zip

http://mirror.khlug.org/apache/struts/documentation/struts-1.3.10-docs.zip

적당한 곳에 압축을 풀고

docs는 api 를 보는 용도로

lib 폴더에 있는 jar 파일은 struts framework 를 사용할 때 쓴다.

1. Eclipse 에서 Struts Framework 을 사용하기 위해서 lib 폴더의 jar 파일을

Eclipse 웹 프로젝트 아래 WebContent/WEB-INF/lib 폴더에 복사해서 사용한다.

2. 웹 프로젝트 아래 WebContent/WEB-INF 아래 struts-config.xml 파일을 생성한다.


<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts-config PUBLIC
 "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
 "http://struts.apache.org/dtds/struts-config_1_3.dtd">

을 복사한 후 사용한다.

Struts 관련 링크

Struts 개발

Struts, 오픈소스 MVC 구현

출처 – IBM Developerworks