You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,7 +36,7 @@ public class LambdaHandler implements RequestHandler<AwsProxyRequest, AwsProxyRe
36
36
```
37
37
38
38
### Spring support
39
-
The library supports Spring applications that are configured using annotations (in code) rather than in an XML file. The simplest possible configuration uses the `@ComponentScan` annotation to load all controller classes from a package. For example, our unit test application has the following configuuration class.
39
+
The library supports Spring applications that are configured using annotations (in code) rather than in an XML file. The simplest possible configuration uses the `@ComponentScan` annotation to load all controller classes from a package. For example, our unit test application has the following configuration class.
40
40
41
41
```java
42
42
@Configuration
@@ -48,15 +48,18 @@ public class EchoSpringAppConfig {
48
48
Once you have declared a configuration class, you can initialize the library with the class name:
You can enable Spring Profiles (as defined with the `@Profile` annotation) by using the `SpringLambdaContainerHandler.activateSpringProfiles(String...)` method - common drivers of this might be the AWS Lambda stage that you're deployed under, or stage variables. See [@Profile documentation](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/Profile.html) for details.
62
+
60
63
### Spark support
61
64
The library also supports applications written with the [Spark framework](http://sparkjava.com/). When using the library with Spark, it's important to initialize the `SparkLambdaContainerHandler` before defining routes.
Copy file name to clipboardExpand all lines: aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/model/AwsProxyRequest.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -43,17 +43,17 @@ public class AwsProxyRequest {
43
43
44
44
@JsonIgnore
45
45
publicStringgetQueryString() {
46
-
Stringparams = "";
46
+
StringBuilderparams = newStringBuilder("");
47
47
48
48
if (this.getQueryStringParameters() != null && this.getQueryStringParameters().size() > 0) {
49
49
for (Stringkey : this.getQueryStringParameters().keySet()) {
Copy file name to clipboardExpand all lines: aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsProxyHttpServletRequest.java
+35-16Lines changed: 35 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ public String getPathTranslated() {
176
176
177
177
@Override
178
178
publicStringgetContextPath() {
179
-
return"/";
179
+
returnrequest.getRequestContext().getStage();
180
180
}
181
181
182
182
@@ -213,10 +213,15 @@ public String getRequestURI() {
Copy file name to clipboardExpand all lines: aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/servlet/AwsServletContext.java
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -485,4 +485,8 @@ public static ServletContext getInstance(Context lambdaContext) {
Copy file name to clipboardExpand all lines: aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/internal/testutils/AwsProxyRequestBuilder.java
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ public AwsProxyRequestBuilder(String path, String httpMethod) {
Copy file name to clipboardExpand all lines: aws-serverless-java-container-core/src/test/java/com/amazonaws/serverless/proxy/internal/servlet/AwsProxyHttpServletRequestTest.java
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@
8
8
importjavax.ws.rs.core.HttpHeaders;
9
9
importjavax.ws.rs.core.MediaType;
10
10
11
+
importjava.util.Collections;
12
+
importjava.util.Enumeration;
13
+
importjava.util.List;
14
+
11
15
importstaticorg.junit.Assert.*;
12
16
13
17
publicclassAwsProxyHttpServletRequestTest {
@@ -39,6 +43,16 @@ public class AwsProxyHttpServletRequestTest {
0 commit comments