-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added proxiable property to ServletRequest, Context, and Response sup…
…pliers to allow injection in a request scope. Addresses issue #211
- Loading branch information
Showing
4 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...y/src/test/java/com/amazonaws/serverless/proxy/jersey/providers/ServletRequestFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.amazonaws.serverless.proxy.jersey.providers; | ||
|
||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.container.ContainerRequestFilter; | ||
import javax.ws.rs.core.Context; | ||
|
||
import java.io.IOException; | ||
|
||
|
||
public class ServletRequestFilter implements ContainerRequestFilter { | ||
public static final String FILTER_ATTRIBUTE_NAME = "ServletFilter"; | ||
public static final String FILTER_ATTRIBUTE_VALUE = "done"; | ||
|
||
@Context HttpServletRequest request; | ||
|
||
public void filter(ContainerRequestContext ctx) throws IOException { | ||
request.setAttribute(FILTER_ATTRIBUTE_NAME, FILTER_ATTRIBUTE_VALUE); | ||
} | ||
|
||
} |