1. 스트럿츠1 다운받기
주소 : http://struts.apache.org/ 다운링크 : http://struts.apache.org/download.cgi#struts1310
다운받은 압축파일을 내가 알 수 있는 폴더에 풀어줍니다.
2. 이클립스에 스트럿츠1 사용할 프로젝트 생성
3. 생성한 프로젝트 web-inf\lib\ 폴더에 스트럿츠1 lib\jar파일들 붙여넣기
- 스트럿츠1 압축 푼 폴더\lib\몽땅 복사
- 새로 생성한 프로젝트 WebContent\WEB-INF\lib 폴더에 몽땅 붙여넣기
4. web.xml, struts-config.xml 수정
- 스트럿츠 압축푼 폴더 apps\struts-blank-1.3.10.war 압축 풀기.
- WEB-INF\web.xml, struts-config.xml
- web.xml은 열어서 이클립스 프로젝트에 있는 web.xml을 수정한다.
- <web.xml>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>st1</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<!-- 붙여넣기 할 부분 -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
- struts-config.xml은 WEB-INF에 붙여넣기 후 아래와 같이 수정
- <struts-config.xml> 수정
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<!-- ================================================ Form Bean Definitions -->
<form-beans>
<form-bean name="userForm" type="org.thinker.actions.UserForm"/>
</form-beans>
<!-- ========================================= Global Exception Definitions -->
<global-exceptions>
</global-exceptions>
<!-- =========================================== Global Forward Definitions -->
<global-forwards>
</global-forwards>
<!-- =========================================== Action Mapping Definitions -->
<action-mappings>
<action
path="/welcome"
forward="/pages/welcome.jsp"/>
<action path="/sample" type="org.thinker.actions.SampleAction" name="userForm">
<forward name="success" path="/sample2.jsp"/>
</action>
</action-mappings>
</struts-config>
<수정내용>
'프로그램 > 웹프로그래밍' 카테고리의 다른 글
[게시판] list.jsp (0) | 2012.02.23 |
---|---|
[게시판] addBbs.html, addBbsAction.jsp (0) | 2012.02.23 |
[게시판] BbsService - 설계 (0) | 2012.02.23 |
[게시판] BbsServiceImpl (0) | 2012.02.23 |
query maker (0) | 2012.02.23 |