• cxf、struts、spring中web.xml过滤url问题解决方案


    利用struts2自带的正则匹配,应该说这算是最官方的解决方案了 
    在struts.properties中加正则匹配 
    struts.action.excludePattern=/webservice/.*
    web.xml 

    Xml代码  
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
     3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     4     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
     5     http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     6 
     7     <context-param>
     8         <param-name>contextConfigLocation</param-name>
     9         <param-value>classpath:com/travelsky/rap/conf/applicationContext.xml</param-value>
    10     </context-param>
    11 
    12     <listener>
    13         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    14     </listener>
    15     <servlet>
    16         <servlet-name>CXFServlet</servlet-name>
    17         <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    18         <load-on-startup>1</load-on-startup>
    19     </servlet>
    20 
    21     <servlet-mapping>
    22         <servlet-name>CXFServlet</servlet-name>
    23         <url-pattern>/webservice/*</url-pattern>
    24     </servlet-mapping>
    25     <!-- struts2 框架启动配置如下: -->
    26     <filter>
    27         <filter-name>struts2</filter-name>
    28         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    29     </filter>
    30     <filter-mapping>
    31         <filter-name>struts2</filter-name>
    32         <url-pattern>/*</url-pattern>
    33     </filter-mapping>
    34 
    35     <welcome-file-list>
    36         <welcome-file>login.jsp</welcome-file>
    37     </welcome-file-list>
    38 </web-app>

    参考:http://chyx72.iteye.com/blog/1436368

  • 相关阅读:
    tomcat修改端口
    JSP_大并发_秒杀
    Nexus刷官方下载的映像_occam
    Nexus杂
    多项式ADT加法乘法——数组实现
    单链表——游标实现
    链表基本操作实现
    二叉查找树
    AVL树
    ORM框架疏理——廖雪峰实战系列(一)
  • 原文地址:https://www.cnblogs.com/anee/p/3443144.html
Copyright © 2020-2023  润新知