You can use the @Context annotation:
@POST
@Path("/test")
@Produces(MediaType.APPLICATION_JSON)
public String showTime(
@FormParam("username") String userName,
@Context HttpServletRequest httpRequest
) {
// The method body
}
You can use the @Context annotation:
@POST
@Path("/test")
@Produces(MediaType.APPLICATION_JSON)
public String showTime(
@FormParam("username") String userName,
@Context HttpServletRequest httpRequest
) {
// The method body
}