I am implementing rest web service using Jersey. I need to have object of ServletContext to save the file in the application directory. Please help me to get the context.
Use @Context, here is Jersey documentation
@Context private ServletContext context;
UPDATED - you can also inject directly into methods if desired
public String uploadNotices(@Context ServletContext context, ...)