Posts

Showing posts with the label jax-rs

GET in JAX-RS with multiple parameters separated by &

Image
Clash Royale CLAN TAG #URR8PPP GET in JAX-RS with multiple parameters separated by & I am developing a JAX-RS backend and I would like to develop a service for GET requests like: http://completeDoc?id=23&id=24 where the number of id is variable. I would like some kind of @GET and @PathParam annotation to extract the List of id s id So far my code looks like this: @GET @Path("/completeDoc") @Produces("application/msword") public Response getCompleteDoc(@QueryParam("id") int id) { System.out.println(id); return Response.status(Response.Status.NOT_FOUND).build(); } Obviously as it is it reads only the first id. If you want multiple int values, use int . That seems fairly obvious, right? – Andreas 1 hour ago int int Or List<Integer> . – shmosel ...

Jersey: where does LogginFeature log?

Image
Clash Royale CLAN TAG #URR8PPP Jersey: where does LogginFeature log? I have a Jersey 2.23 running inside of a glassfish/grizzly webserver. That is working well. Now I try to enable LoggingFeture for logging any access to the service. ResourceConfig rc = new ResourceConfig (); rc.packages (MyProg.class.getPackage ().getName ()); rc.register (LoggingFeature.class); rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, "INFO"); rc.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY_SERVER, LoggingFeature.Verbosity.HEADERS_ONLY); HttpServer hs = GrizzlyHttpServerFactory.createHttpServer (URI.create ("http://myserver"), rc); I do not find any new files where it puts the logs in my apps dir or in /var/log. If someone can please explain to me if my code is ok and where to look. I would expect a file where it puts a line for any new request to the server (like access.log of Apache) Thanks! By...