zoukankan      html  css  js  c++  java
  • 在 web 容器中运行 cxf

    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    
    
    <web-app>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>WEB-INF/beans.xml</param-value>
        </context-param>
    
        <listener>
            <listener-class>
                org.springframework.web.context.ContextLoaderListener
            </listener-class>
        </listener>
    
        <servlet>
            <servlet-name>CXFServlet</servlet-name>
            <display-name>CXF Servlet</display-name>
            <servlet-class>
                org.apache.cxf.transport.servlet.CXFServlet
            </servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>CXFServlet</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>
    </web-app>

    listener-class 是入口 (spring-web-4.1.6.RELEASE)

    param-name 是固定写法,位于org.springframework.web.context.ContextLoader

       /**
         * Name of servlet context parameter (i.e., {@value}) that can specify the
         * config location for the root context, falling back to the implementation's
         * default otherwise.
         * @see org.springframework.web.context.support.XmlWebApplicationContext#DEFAULT_CONFIG_LOCATION
         */
        public static final String CONFIG_LOCATION_PARAM = "contextConfigLocation";

    CXFServlet 指定的class 位于 cxf-rt-transports-http-3.1.1.jar

    Lets assume you have a web application called 'rest' (example, a 'rest.war' archive). CXFServlet's url-pattern is "/test/*". Finally, jaxrs:server's address is "/bar".

    Requests like /rest/test/bar

  • 相关阅读:
    世界十大黑客简介
    Workerman
    获取当前页面完整路径的方法:
    冒泡排序
    伪静态规则
    PHP如何打印出curl 模块交互的 http 请求与响应 header?
    转 浅谈 PHP 与手机 APP 开发(API 接口开发)
    银联chinapay支付接口实现详解
    PHP webservice 接口实例
    spl_autoload_register方法
  • 原文地址:https://www.cnblogs.com/zno2/p/4686499.html
Copyright © 2011-2022 走看看