问题
I am using Jersey Grizzly and want to implement Basic Authentication to Grizzly. I create my grizzly server as follows:
ResourceConfig rc = new PackagesResourceConfig("com.abc.de");
GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
at another class I have something like:
@GET
@Produces("text/plain")
@Path("/description")
public String getDescription() {
String description = "probeDescription";
return description;
}
I don't know the difference and main concepts of jersey and grizzly. What jersey can't do that grizzly can. However I want that if a user wants to get description it should pass the basic authentication.
Any ideas about how can I implement it?
回答1:
I followed that example: http://java.net/projects/jersey/sources/svn/show/trunk/jersey/samples/https-clientserver-grizzly?rev=5752 and it works.
来源:https://stackoverflow.com/questions/11325334/basic-authentication-at-grizzly-server