Saturday, 15 March 2014

java - Defining the correct resource path in web.xml? -



java - Defining the correct resource path in web.xml? -

i'm working through tutorial: http://www.vogella.com/articles/rest/article.html#installation

and don't understand line says "this property must point resources classes." step:

5.3. define bailiwick of jersey servlet dispatcher need register bailiwick of jersey servlet dispatcher rest requests. open file web.xml , modify file following. <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>de.vogella.jersey.first</display-name> <servlet> <servlet-name>jersey rest service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>de.vogella.jersey.first</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey rest service</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app> parameter "com.sun.jersey.config.property.package" defines in bundle bailiwick of jersey web service classes. property must point resources classes. url pattern defines part of base of operations url application placed.

i've placed bailiwick of jersey jars web-inf/lib folder. can utilize path provided in tutorial or should utilize else?

he's describing com.sun.jersey.config.property.package property. should bundle containing rest resources in project. unrelated adding bailiwick of jersey library lib folder. gets in section 7.3 of tutorial. long you're putting rest classes in same bundle can leave is.

java rest tomcat jersey

No comments:

Post a Comment