@GET
Produces("application/xlm")
public String getData(@Context HttpServletRequest request){
String ip = request.getRemoteAddr();
} |
@GET
Produces("application/xlm")
public String getData(@Context HttpServletRequest request){
String ip = request.getRemoteAddr();
}
Die Annotation @Context kann folgende Objekte injizieren:
- javax.ws.rs.core.HttpHeaders
- javax.ws.rs.core.UriInfo
- javax.ws.rs.core.Request
- javax.servlet.HttpServletRequest
- javax.servlet.HttpServletResponse
- javax.servlet.ServletConfig
- javax.servlet.ServletContext
- javax.ws.rs.core.SecurityContext
dvAppBean.getServletContext().getInitParameter(Constants.XYZ_SEARCH_LIMIT) |
dvAppBean.getServletContext().getInitParameter(Constants.XYZ_SEARCH_LIMIT)