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

  • 相关阅读:
    chapter01 Bob'store
    echo拼接
    《PHP和MySql Web》书,<input>属性
    http协议
    asc18_hpl,hpc,hpcg
    考研北邮总结[转发共享]
    考研经验总结【转发共享】
    ISBN号码 201312-2
    出现次数最多的数 201312-1
    相反数 201403-1
  • 原文地址:https://www.cnblogs.com/zno2/p/4686499.html
Copyright © 2011-2022 走看看