I currently try out the Grizzly-Framework 2.3.6. I am using the following maven dependency:
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-framework</artifactId>
<version>2.3.6</version>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http-server</artifactId>
<version>2.3.6</version>
</dependency>
I can start a server with the following code example:
HttpServer server = HttpServer.createSimpleServer();
try {
server.start();
addJaxRS(server);
System.out.println("Press any key to stop the server...");
System.in.read();
} catch (Exception e) {
System.err.println(e);
}
I added the following JAX-RS Class:
@Path("/helloworld")
public class HelloWorldResource {
@GET
@Produces("text/plain")
public String getClichedMessage() {
return "Hello World";
}
}
My question is: how can I tell grizzly to add the HelloWorldRessoruce as a JAX-RS Resource?