상단

Struts를 정리 한다.

 

GAE용 Struts 환경 설정


  • 라이브러리

 
 struts2-core-2.0.12.jar
 xwork-2.0.6.jar
 ognl-2.6.11.jar
 freemarker-2.3.8.jar
 
 commons-fileupload.jar
 commons-io.jar
 commons-logging.jar
 
 //--- 추가로 등록할 라이브러리
 javassist.jar
 
  • /WEB-INF/web.xml

    • 필터 순서 : struts-cleanup, sitemesh, struts2

 
 	
 		struts-cleanup
 		org.apache.struts2.dispatcher.ActionContextCleanUp
 	
 
 	
 		struts-cleanup
 		/*
 	
 
 	
 		struts2
 		org.apache.struts2.dispatcher.FilterDispatcher
 	
 
 	
 		struts2
 		/*
 	
 
 	
 		com.jopenbusiness.gae.framework.OgnlListener
 	
 
 
 
 
 
 
     
     
     	
     	
 
     
     
     
     
 
 
  • /WEB-INF/classes/struts-approve.xml

 
 
 
 
 
 	
 		
         	        /jsp/helloWorld.jsp
      	        
 	
 
 
  • HelloWorldAction.java

 
 package com.daou.gae.approve.action;
 
 import com.opensymphony.xwork2.ActionSupport;
 
 public class HelloWorldAction extends ActionSupport { 
 	private static final long serialVersionUID = -8975313985288714701L;
 
     public String execute() throws Exception {
           return SUCCESS;
     }
 }
 
  • /jsp/helloWorld.jsp

 
 <%@ page pageEncoding="UTF-8" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
 
 <html>
     <head>
         <title>Hello world!</title>
     </head>
 
     <body>
         <h2>Hello world!</h2>
     </body>
 </html>
 
  • OgnlListener.java

 
 package com.jopenbusiness.gae;
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
 import ognl.OgnlRuntime;
 
 public class OgnlListener implements ServletContextListener {
 	public void contextDestroyed(ServletContextEvent arg0) {
 	}
 
 	public void contextInitialized(ServletContextEvent arg0) {
 		OgnlRuntime.setSecurityManager(null);
 	}
 }
 
 
 

사용자 가이드


 

관리자 가이드


 

참고 문헌


 

분류: Spring 
Java

최종 수정일: 2024-09-30 12:26:18

이전글 :
다음글 :