zoukankan      html  css  js  c++  java
  • 配置struts-2.5.16必需jar包Struts2的特性变动

    1、jar包的变动

    必需jar包,旧版本:

      

    必需jar包,新版本:

      

    在struts-2.5.16版本的lib目录下没有xwork-core的jar包,原因是被合并到struts-core这个jar里了。所谓core嘛,当然是一个核心,原来两个合并成一个也是有道理的。

      

    2、web.xml文件配置过滤器变动

    if you are using struts2 version 2.5 you need to change from 
    
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 
    
    to
    
    org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

      是的,去掉了中间.ng文件空间名,原因是在整合xwork的时候,同时简化了不必要的包名空间。

    <?xml version="1.0" encoding="UTF-8"?>
    <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_3_0.xsd" version="3.0">
    <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
    <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
    </web-app>

    3、在项目根目录空间下创建struts.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
      "http://struts.apache.org/dtds/struts-2.3.dtd">
    <struts> </struts>
  • 相关阅读:
    python--tkinter桌面编程开发--记事本
    Python--面向对象编程
    Python--面向对象编程--时钟实例开发
    Python学习笔记--2--面向对象编程
    Python学习笔记--1
    epoll聊天室的实现
    操作系统--虚拟存储器
    操作系统--存储器管理
    操作系统--分页存储管理中逻辑地址转换为物理地址
    操作系统--处理机调度与死锁
  • 原文地址:https://www.cnblogs.com/chenmingjun/p/9205033.html
Copyright © 2011-2022 走看看