Configuring web.xml for webservices and servlet.

Posted by Win Man on Stack Overflow See other posts from Stack Overflow or by Win Man
Published on 2010-06-15T02:20:16Z Indexed on 2010/06/15 2:22 UTC
Read the original article Hit count: 304

Filed under:
|
|

Hi,

I am new to Restlets. Trying to configure the web.xml (on JBoss). I have 2 entries, one for a servlet (got nothing to do with webservices) other for webservices, using Restlet. Here are the entries..

 <servlet>
  <servlet-name>AuthenticationServlet</servlet-name>
  <servlet-class>com.safeid.web.server.api.servlet.AuthenticationServlet</servlet-class>
  <load-on-startup>2</load-on-startup>
 </servlet>

 <servlet-mapping>
  <servlet-name>AuthenticationServlet</servlet-name>
  <url-pattern>/authenticate/*</url-pattern>
 </servlet-mapping>


<!--  Start of Entries for the REST Web Services. -->

  <context-param>
   <param-name>org.restlet.application</param-name>
   <param-value>com.safeid.web.server.SafeIDRouterApplication</param-value>
  </context-param>

 <servlet>
  <servlet-name>RestletServlet</servlet-name>
  <servlet-class>com.noelios.restlet.ext.servlet.ServerServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>


 <servlet-mapping>
  <servlet-name>RestletServlet</servlet-name>
  <url-pattern>/*</url-pattern>
 </servlet-mapping>
<!-- END of Entries for the REST Web Services.-->

Both don't work together. In the above setup the Restlet works. However when I change the

RestletServlet /*

to something like

<servlet-mapping>
  <servlet-name>RestletServlet</servlet-name>
  <url-pattern>/credential/*</url-pattern>
 </servlet-mapping>

the Restlet stop working and the AuthenticationServlet works fine. What am I missing here?

© Stack Overflow or respective owner

Related posts about servlets

Related posts about restlet