English 中文(简体)
多个日本宇宙航空研究开发机构的申请
原标题:Multiple JAX-RS applications

我在网站xml中具体提到我的日本宇宙航空研究开发机构-RS应用情况如下:

<servlet>
<servlet-name>CXFServlet</servlet-name>     
<servlet-class>
org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet
</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>
com.myapp.MYRestApplication       
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet> 

难道我可以将另一个日本宇宙航空研究开发机构-RS应用类别传给这个CXF服务器吗?

Regards, Anand

最佳回答

虽然CXF可以在单一服务器内管理多个日本宇宙航空研究开发厅-RS应用——我用自己的代码使用这一配置——但很复杂,你更不用改用星基配置。 <代码>CXFNon SpringJaxrsServlet只能支持有限配置。 在我的法典中,我有这种说法(因为我也使用春天的安全,但你可以放弃过滤):

<!-- Location of the main Spring/CXF configuration file -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>WEB-INF/beans.xml</param-value>
</context-param>

<!-- Apply Spring Security as a wrapper to everything --> 
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<!-- Hook for Spring lifecycle management; you want this -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- A single servlet to handle all CXF processing -->
<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>
问题回答

暂无回答




相关问题
Can t access locally hosted project via the internet?

I m currently developing a Java Servlet Project in Eclipse. The project is compiled via Tomcat 5.5 and hosted in localhost:8080(alternatively 127.0.0.1:8080 AND 192.168.1.10:8080 which also happens ...

JSP programmatically render

I need to programmatically render JSP page. As far as I understand, JSP should have some compiler. The question is can I use this compiler dirrectly without JspServlet and others? All I need is ...

Javascript redirect

I am working with javascript and here is what I am trying to do: 1. Send a get request which looks like "http://localhost:8080/myapp/verify.htm?verifyId=Agkvhs" My requests reaches my verify.jsp in ...

热门标签