struts2.5.x环境配置

  • 开发环境
    Myeclipse2017 / Tomcat8.5 / Struts2.5.12
  • jar包导入
1.  commons-fileupload-1.3.3.jar  
2.  commons-io-2.4.jar  
3.  commons-lang3-3.3.6.jar  
4.  commons-logging-1.1.3.jar  
5.  freemarker-2.3.23.jar  
6.  javassist-3.20.0-GA.jar  
7.  log4j-api-2.5.jar  
8.  log4j-core-2.8.2.jar
9.  ognl-3.1.12.jar  
10. struts2-core-2.5.2.jar  
  • 在web.xml中编写配置文件
    
        struts2
        org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
    

    
        struts2
        /*
    
  • 写struts2.xml文件



        

    
    
        
        
            /hello.jsp
            
        
    
    

  • 写java类实现execute()方法
package action;

public class action1 {
    public String  execute() {
        System.out.println("action1");
        return "success";
    }
}
  • 对应的jsp页面(只是简单显示而已)命名要和struts.xml中的result中的值对应,通过浏览器访问。
struts2.5.x环境配置_第1张图片

你可能感兴趣的:(struts2.5.x环境配置)