RestEasy与Spring结合

举报
隔壁老汪 发表于 2022/06/24 23:25:17 2022/06/24
【摘要】 RESTEasy integrates with Spring 3.0.x. We are interested in other forms of Spring integration, so please help contribute. 41.1. Basic Integration For Maven users, yo...








<dependency>    <groupId>org.jboss.resteasy</groupId>    <artifactId>resteasy-spring</artifactId>    <version>whatever version you are using</version></dependency>
 




<web-app>   <display-name>Archetype Created Web Application</display-name>   <listener>      <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>   </listener>   <listener>      <listener-class>org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>   </listener>   <servlet>      <servlet-name>Resteasy</servlet-name>      <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>   </servlet>   <servlet-mapping>      <servlet-name>Resteasy</servlet-name>      <url-pattern>/*</url-pattern>   </servlet-mapping></web-app>
 
















<web-app>   <display-name>Archetype Created Web Application</display-name>   <servlet>      <servlet-name>Spring</servlet-name>      <servlet-class>org.springframework.web.servlet.DispatcherServlet;</servlet-class>   </servlet>   <servlet-mapping>      <servlet-name>Spring</servlet-name>      <url-pattern>/*</url-pattern>   </servlet-mapping></web-app>
 


<beans xmlns="http://www.springframework.org/schema/beans"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xsi:schemaLocation="    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">    <!-- Import basic SpringMVC Resteasy integration -->    <import resource="classpath:springmvc-resteasy.xml"/>....
 




<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"    xmlns:util="http://www.springframework.org/schema/util"    xsi:schemaLocation="        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd        ">    <!-- Import basic SpringMVC Resteasy integration -->    <import resource="classpath:springmvc-resteasy.xml" />    <!-- override the bean definition for deployment -->    <bean id="resteasy.deployment" class="org.jboss.resteasy.spi.ResteasyDeployment" init-method="start" destroy-method="stop">        <property name="asyncJobServiceEnabled" value="true"/>        <property name="mediaTypeMappings">            <map>                <entry key="json" value="application/json" />                <entry key="xml" value="application/xml" />            </map>        </property>    </bean>...
 

文章来源: blog.csdn.net,作者:隔壁老瓦,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/wxb880114/article/details/84431763

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。