Skip to content

Inject ServletContext and HttpServletResponse automatically #30

@ggallotti

Description

@ggallotti

Having hundrerds of Jersey endpoints where ServletContext and HttpServletResponse is inyected, when using 'aws-serverless-java-container' I have to modify the code in order to obtain the Servlet context from the Request.

Could be simpler if the ServletContext and HttpServletResponse could be inyected as HttpServletRequest is.

@Context
   private ServletContext myContext;
   @Context
   private javax.servlet.http.HttpServletRequest myServletRequest;
   @Context
   private javax.servlet.http.HttpServletResponse myServletResponse;
   @POST
   @Consumes({MediaType.APPLICATION_JSON})
   @Produces({MediaType.APPLICATION_JSON + ";charset=UTF-8"})
   public Response execute( com.awslambdatest.simpletest_RESTInterfaceIN entity )
   {
..
..
}

I'm already inyecting HttpServletRequest this way:
https://github.com/awslabs/aws-serverless-java-container#jersey-servlet-request

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions