Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

Problem with REST webservice

$
0
0

Hey guys!

 

I'm trying to implementing a plugin using RESTEasy but i can't access my webservice url. I can deploy my plugin without an error.

 

Here is what i did:

 

web-custom.xml

<web-app>     <context-param>        <param-name>javax.ws.rs.Application</param-name>        <param-value>testapp.openfire.TestApplication</param-value>    </context-param>      <listener>        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</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>/plus/*</url-pattern>    </servlet-mapping></web-app>

 

And the class that represents my web service:

 

@Path("/user")publicclass UserResource {     @GET    @Path("/teste")    @Produces({MediaType.TEXT_PLAIN})    public String teste(){        System.out.println("HERE WE ARE");        return"test";    } }

 

The class that implements Plugin

 

publicclass TestPlugin implements Plugin {         @Override    publicvoid initializePlugin(PluginManager manager, File pluginDirectory) {        System.out.println("START");    }     @Override    publicvoid destroyPlugin() {        System.out.println("DESTROY");    }}

 

 

What's wrong?

 

Can i use REST webservices or i need to use Servlets to interact with clients?


Thanks in advance.

 

David


Viewing all articles
Browse latest Browse all 10742

Trending Articles