users@glassfish.java.net

Where does Glassfish put RESTful URLs?

From: <forums_at_java.net>
Date: Mon, 24 Oct 2011 17:09:29 -0500 (CDT)

I've got a .ear file that contains a .war with a RESTful web service.  If I
go to localhost:8080/appname [1] the index.jsp page is displayed so the .war
file was deployed correctly.  If I try to send a GET to the RESTful web
service using its URL localhost:8080/appname/rest/sendMessageWithReplyTo [2]
I get a 404 error.

Is there some way to make Glassfish tell me where it put my RESTful web
service?

Here are my web.xml and Rest class implementation:

<web-app> <display-name>rest.resource</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>rest.resource</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>
 

@Path("/sendMessageWithReplyTo") public class SendMessageWithReplyToResource
{ @GET @Produces(MediaType.TEXT_HTML) public String
callSendMessageWithReplyTo() { return "<html> " + "<title>" +
"callSendMessageWithReplyTo()" + "</title>" + "<body><h1>" + "Called
sendMessageWithReplyTo()" + "</body></h1>" + "</html> "; } }

[1] http://localhost:8080/appname
[2] http://localhost:8080/appname/rest/sendMessageWithReplyTo

--
[Message sent by forum member 'dwschulze']
View Post: http://forums.java.net/node/856647