正在加载图片...
FUDAN-adweb MyEclipse开发基于 Restful的 Web Service教程 whh 23勾选需要的jar文件(重要,缺少某些jar文件会在后面部署测试时报错),需要勾 i/ JAXB, Core, Server, Client, JSON New Web Service Project Project Servlet and Library Configuration Configure the JAX-RS servlet add JAX-RS RI(Project Jersey) libraries to Servlet name: JAX-RS REST Servlet JAX-RS version: JAX-RS 1.1(Project Jersey 1.4) Select the libraries to add to project buildpath Show: MyEclipse Libraries User Libraries V JAX-RS 1.1 JAXB Libraries(Project Jersey 1.4)-<MyEclipse-Libraryi U JAX-RS 1.1 Core Libraries(Project Jersey 14)-<MyEclipse-Library> V JAX-RS 1.1 Server Libraries(Project Jersey 1.4)-<MyEclipse-Library> V JAX-RS 1.1 Client Libraries(Project Jersey 1.4)-<MyEclipse-Library D JAX-RS 1.1 Jackson Libraries( Project Jersey 1.4)-<MyEclipse-Library> mes project把y上ypye F JAX-RS 1.1 FastInfoset Libraries( Project Jersey 1.4).<MyEclipse-Library> JAX-RS 1.1 Mail MIME Multipart Libraries(Project Jersey 1. 4)-<MyEclipse-Lib View and edit libranes x Back Next> Finish Cancel 24点击 finish完成工程创建。查看 MyWebService Demo WebRoot→WEB-| newel 文件,里面有 servlet相关配置 1 <xml version="1.0" encoding="UTF-8?> 2<web-app version-3. xmins-"Http: //java. sun com/xml/ns/javae xmins:xsi-http://wl.wv3.org/2001/xmlschema-instance http://java.suncom/xml/ns/javaee/wveb-app30.xsd"> 7 <display-name></display-name> 8-<servlet display-name>JAX-RS REST Servlet</display-name> com. sun.jersey. spi container servlet. Servletcontainer </servlet-class> <servlet-name >JAX-RS REST Servlet</servlet-name> <url-pattern>/services/*</url-pattern> </welcome-file-lis 2/9FUDAN-adweb MyEclipse 开发基于 Restful 的 Web Service 教程 whh 2 / 9 2.3 勾选需要的 jar 文件(重要,缺少某些 jar 文件会在后面部署测试时报错),需要勾 选 JAXB, Core, Server, Client, JSON: 2.4 点击 finish 完成工程创建。查看 MyWebServiceDemoWebRootWEB-INFweb.xml 文件,里面有 servlet 相关配置:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有