From 7bdf594dd22f8431a2e4e3e774649de151f3d97a Mon Sep 17 00:00:00 2001 From: Johannes Geppert Date: Wed, 17 Aug 2022 12:54:37 +0200 Subject: [PATCH] Rename class file names for Struts implementation without version number https://github.com/awslabs/aws-serverless-java-container/issues/471 --- .../continuous-integration-workflow.yml | 4 +- .../StrutsLambdaContainerHandler.java} | 67 +++++++++++-------- .../StrutsLambdaHandler.java} | 8 +-- .../StrutsAwsProxyTest.java} | 18 +++-- .../echoapp/EchoAction.java | 2 +- .../echoapp/EchoRequestInfoAction.java | 2 +- .../src/test/resources/struts.xml | 4 +- .../archetype-resources/build.gradle | 2 +- .../resources/archetype-resources/pom.xml | 10 +-- .../test/java/StreamLambdaHandlerTest.java | 6 +- .../archetype-resources/template.yml | 4 +- .../projects/base/archetype.properties | 2 +- .../{struts2 => struts}/pet-store/README.md | 6 +- .../pet-store/build.gradle | 0 samples/{struts2 => struts}/pet-store/pom.xml | 2 +- .../pet-store/src/main/assembly/dist.xml | 0 .../sample/struts/actions/PetsController.java | 0 .../serverless/sample/struts/model/Pet.java | 0 .../sample/struts/model/PetData.java | 0 .../pet-store/src/main/resources/log4j2.xml | 0 .../pet-store/src/main/resources/struts.xml | 0 .../pet-store/template.yml | 6 +- 22 files changed, 76 insertions(+), 67 deletions(-) rename aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/{struts2/Struts2LambdaContainerHandler.java => struts/StrutsLambdaContainerHandler.java} (59%) rename aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/{struts2/Struts2LambdaHandler.java => struts/StrutsLambdaHandler.java} (79%) rename aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/{struts2/Struts2AwsProxyTest.java => struts/StrutsAwsProxyTest.java} (95%) rename aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/{struts2 => struts}/echoapp/EchoAction.java (96%) rename aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/{struts2 => struts}/echoapp/EchoRequestInfoAction.java (98%) rename samples/{struts2 => struts}/pet-store/README.md (91%) rename samples/{struts2 => struts}/pet-store/build.gradle (100%) rename samples/{struts2 => struts}/pet-store/pom.xml (98%) rename samples/{struts2 => struts}/pet-store/src/main/assembly/dist.xml (100%) rename samples/{struts2 => struts}/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/actions/PetsController.java (100%) rename samples/{struts2 => struts}/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/Pet.java (100%) rename samples/{struts2 => struts}/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/PetData.java (100%) rename samples/{struts2 => struts}/pet-store/src/main/resources/log4j2.xml (100%) rename samples/{struts2 => struts}/pet-store/src/main/resources/struts.xml (100%) rename samples/{struts2 => struts}/pet-store/template.yml (84%) diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 5c55e7b70..e1ae0e00b 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -75,9 +75,9 @@ jobs: run: ./gha_build.sh springboot2 false false -Dspringboot.version=2.5.14 -Dspring.version=5.3.20 -Dspringsecurity.version=5.5.8 -Ddependency-check.skip=true build_struts2: - name: Build and test Struts 2 + name: Build and test Struts runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build latest - run: ./gha_build.sh struts2 true true + run: ./gha_build.sh struts true true diff --git a/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaContainerHandler.java b/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaContainerHandler.java similarity index 59% rename from aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaContainerHandler.java rename to aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaContainerHandler.java index 99c89c449..42ff0aee8 100644 --- a/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaContainerHandler.java +++ b/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaContainerHandler.java @@ -10,11 +10,22 @@ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -package com.amazonaws.serverless.proxy.struts2; +package com.amazonaws.serverless.proxy.struts; import com.amazonaws.serverless.exceptions.ContainerInitializationException; -import com.amazonaws.serverless.proxy.*; -import com.amazonaws.serverless.proxy.internal.servlet.*; +import com.amazonaws.serverless.proxy.AwsHttpApiV2SecurityContextWriter; +import com.amazonaws.serverless.proxy.AwsProxyExceptionHandler; +import com.amazonaws.serverless.proxy.AwsProxySecurityContextWriter; +import com.amazonaws.serverless.proxy.ExceptionHandler; +import com.amazonaws.serverless.proxy.RequestReader; +import com.amazonaws.serverless.proxy.ResponseWriter; +import com.amazonaws.serverless.proxy.SecurityContextWriter; +import com.amazonaws.serverless.proxy.internal.servlet.AwsHttpApiV2HttpServletRequestReader; +import com.amazonaws.serverless.proxy.internal.servlet.AwsHttpServletRequest; +import com.amazonaws.serverless.proxy.internal.servlet.AwsHttpServletResponse; +import com.amazonaws.serverless.proxy.internal.servlet.AwsLambdaServletContainerHandler; +import com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletRequestReader; +import com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletResponseWriter; import com.amazonaws.serverless.proxy.internal.testutils.Timer; import com.amazonaws.serverless.proxy.model.AwsProxyRequest; import com.amazonaws.serverless.proxy.model.AwsProxyResponse; @@ -32,26 +43,26 @@ import java.util.concurrent.CountDownLatch; /** - * A Lambda handler to initialize the Struts2 filter and proxy the requests. + * A Lambda handler to initialize the Struts filter and proxy the requests. * * @param request type * @param response type */ -public class Struts2LambdaContainerHandler extends AwsLambdaServletContainerHandler { +public class StrutsLambdaContainerHandler extends AwsLambdaServletContainerHandler { - private static final Logger log = LoggerFactory.getLogger(Struts2LambdaContainerHandler.class); + private static final Logger log = LoggerFactory.getLogger(StrutsLambdaContainerHandler.class); public static final String HEADER_STRUTS_STATUS_CODE = "X-Struts-StatusCode"; - private static final String TIMER_STRUTS_2_CONTAINER_CONSTRUCTOR = "STRUTS2_CONTAINER_CONSTRUCTOR"; - private static final String TIMER_STRUTS_2_HANDLE_REQUEST = "STRUTS2_HANDLE_REQUEST"; - private static final String TIMER_STRUTS_2_COLD_START_INIT = "STRUTS2_COLD_START_INIT"; - private static final String STRUTS_FILTER_NAME = "Struts2Filter"; + private static final String TIMER_STRUTS_CONTAINER_CONSTRUCTOR = "STRUTS_CONTAINER_CONSTRUCTOR"; + private static final String TIMER_STRUTS_HANDLE_REQUEST = "STRUTS_HANDLE_REQUEST"; + private static final String TIMER_STRUTS_COLD_START_INIT = "STRUTS_COLD_START_INIT"; + private static final String STRUTS_FILTER_NAME = "StrutsFilter"; private boolean initialized; - public static Struts2LambdaContainerHandler getAwsProxyHandler() { - return new Struts2LambdaContainerHandler( + public static StrutsLambdaContainerHandler getAwsProxyHandler() { + return new StrutsLambdaContainerHandler( AwsProxyRequest.class, AwsProxyResponse.class, new AwsProxyHttpServletRequestReader(), @@ -60,8 +71,8 @@ public static Struts2LambdaContainerHandler g new AwsProxyExceptionHandler()); } - public static Struts2LambdaContainerHandler getHttpApiV2ProxyHandler() { - return new Struts2LambdaContainerHandler( + public static StrutsLambdaContainerHandler getHttpApiV2ProxyHandler() { + return new StrutsLambdaContainerHandler( HttpApiV2ProxyRequest.class, AwsProxyResponse.class, new AwsHttpApiV2HttpServletRequestReader(), @@ -70,17 +81,17 @@ public static Struts2LambdaContainerHandler requestTypeClass, - Class responseTypeClass, - RequestReader requestReader, - ResponseWriter responseWriter, - SecurityContextWriter securityContextWriter, - ExceptionHandler exceptionHandler) { + public StrutsLambdaContainerHandler(Class requestTypeClass, + Class responseTypeClass, + RequestReader requestReader, + ResponseWriter responseWriter, + SecurityContextWriter securityContextWriter, + ExceptionHandler exceptionHandler) { super(requestTypeClass, responseTypeClass, requestReader, responseWriter, securityContextWriter, exceptionHandler); - Timer.start(TIMER_STRUTS_2_CONTAINER_CONSTRUCTOR); + Timer.start(TIMER_STRUTS_CONTAINER_CONSTRUCTOR); this.initialized = false; - Timer.stop(TIMER_STRUTS_2_CONTAINER_CONSTRUCTOR); + Timer.stop(TIMER_STRUTS_CONTAINER_CONSTRUCTOR); } @Override @@ -92,7 +103,7 @@ protected AwsHttpServletResponse getContainerResponse(HttpServletRequest request protected void handleRequest(HttpServletRequest httpServletRequest, AwsHttpServletResponse httpServletResponse, Context lambdaContext) throws Exception { - Timer.start(TIMER_STRUTS_2_HANDLE_REQUEST); + Timer.start(TIMER_STRUTS_HANDLE_REQUEST); if (!this.initialized) { initialize(); } @@ -105,13 +116,13 @@ protected void handleRequest(HttpServletRequest httpServletRequest, if (responseStatusCode != null) { httpServletResponse.setStatus(Integer.parseInt(responseStatusCode)); } - Timer.stop(TIMER_STRUTS_2_HANDLE_REQUEST); + Timer.stop(TIMER_STRUTS_HANDLE_REQUEST); } @Override public void initialize() throws ContainerInitializationException { log.info("Initialize Struts2 Lambda Application ..."); - Timer.start(TIMER_STRUTS_2_COLD_START_INIT); + Timer.start(TIMER_STRUTS_COLD_START_INIT); try { if (this.startupHandler != null) { this.startupHandler.onStartup(this.getServletContext()); @@ -123,12 +134,12 @@ public void initialize() throws ContainerInitializationException { EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC, DispatcherType.INCLUDE, DispatcherType.FORWARD), true, "/*"); } catch (Exception e) { - throw new ContainerInitializationException("Could not initialize Struts2", e); + throw new ContainerInitializationException("Could not initialize Struts container", e); } this.initialized = true; - Timer.stop(TIMER_STRUTS_2_COLD_START_INIT); - log.info("... initialize of Struts2 Lambda Application completed!"); + Timer.stop(TIMER_STRUTS_COLD_START_INIT); + log.info("... initialize of Struts Lambda Application completed!"); } public Servlet getServlet() { diff --git a/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaHandler.java b/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaHandler.java similarity index 79% rename from aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaHandler.java rename to aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaHandler.java index b4aee76c9..0e1ccfa17 100644 --- a/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts2/Struts2LambdaHandler.java +++ b/aws-serverless-java-container-struts/src/main/java/com/amazonaws/serverless/proxy/struts/StrutsLambdaHandler.java @@ -10,7 +10,7 @@ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -package com.amazonaws.serverless.proxy.struts2; +package com.amazonaws.serverless.proxy.struts; import com.amazonaws.serverless.proxy.model.AwsProxyRequest; import com.amazonaws.serverless.proxy.model.AwsProxyResponse; @@ -25,12 +25,12 @@ * The lambda handler to handle the requests. *

* - * com.amazonaws.serverless.proxy.struts2.Struts2LambdaHandler::handleRequest + * com.amazonaws.serverless.proxy.struts.StrutsLambdaHandler::handleRequest * */ -public class Struts2LambdaHandler implements RequestStreamHandler { +public class StrutsLambdaHandler implements RequestStreamHandler { - private final Struts2LambdaContainerHandler handler = Struts2LambdaContainerHandler + private final StrutsLambdaContainerHandler handler = StrutsLambdaContainerHandler .getAwsProxyHandler(); @Override diff --git a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/Struts2AwsProxyTest.java b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/StrutsAwsProxyTest.java similarity index 95% rename from aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/Struts2AwsProxyTest.java rename to aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/StrutsAwsProxyTest.java index 60666f4af..b4f9ecf95 100644 --- a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/Struts2AwsProxyTest.java +++ b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/StrutsAwsProxyTest.java @@ -10,7 +10,7 @@ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -package com.amazonaws.serverless.proxy.struts2; +package com.amazonaws.serverless.proxy.struts; import com.amazonaws.serverless.proxy.internal.testutils.AwsProxyRequestBuilder; @@ -18,7 +18,7 @@ import com.amazonaws.serverless.proxy.model.AwsProxyRequest; import com.amazonaws.serverless.proxy.model.AwsProxyResponse; import com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest; -import com.amazonaws.serverless.proxy.struts2.echoapp.EchoAction; +import com.amazonaws.serverless.proxy.struts.echoapp.EchoAction; import com.amazonaws.services.lambda.runtime.Context; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -33,7 +33,11 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -45,7 +49,7 @@ * Unit test class for the Struts2 AWS_PROXY default implementation */ @RunWith(Parameterized.class) -public class Struts2AwsProxyTest extends StrutsJUnit4TestCase { +public class StrutsAwsProxyTest extends StrutsJUnit4TestCase { private static final String CUSTOM_HEADER_KEY = "x-custom-header"; private static final String CUSTOM_HEADER_VALUE = "my-custom-value"; private static final String AUTHORIZER_PRINCIPAL_ID = "test-principal-" + UUID.randomUUID().toString(); @@ -56,15 +60,15 @@ public class Struts2AwsProxyTest extends StrutsJUnit4TestCase { private static ObjectMapper objectMapper = new ObjectMapper(); - private final Struts2LambdaContainerHandler handler = Struts2LambdaContainerHandler + private final StrutsLambdaContainerHandler handler = StrutsLambdaContainerHandler .getAwsProxyHandler(); - private final Struts2LambdaContainerHandler httpApiHandler = Struts2LambdaContainerHandler + private final StrutsLambdaContainerHandler httpApiHandler = StrutsLambdaContainerHandler .getHttpApiV2ProxyHandler(); private static Context lambdaContext = new MockLambdaContext(); private String type; - public Struts2AwsProxyTest(String reqType) { + public StrutsAwsProxyTest(String reqType) { type = reqType; } diff --git a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoAction.java b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoAction.java similarity index 96% rename from aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoAction.java rename to aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoAction.java index bfaa0a69f..d64a54eca 100644 --- a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoAction.java +++ b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoAction.java @@ -1,4 +1,4 @@ -package com.amazonaws.serverless.proxy.struts2.echoapp; +package com.amazonaws.serverless.proxy.struts.echoapp; import com.opensymphony.xwork2.ActionSupport; import org.apache.commons.io.IOUtils; diff --git a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoRequestInfoAction.java b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoRequestInfoAction.java similarity index 98% rename from aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoRequestInfoAction.java rename to aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoRequestInfoAction.java index 1d9c1697e..554156e9d 100644 --- a/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts2/echoapp/EchoRequestInfoAction.java +++ b/aws-serverless-java-container-struts/src/test/java/com/amazonaws/serverless/proxy/struts/echoapp/EchoRequestInfoAction.java @@ -1,4 +1,4 @@ -package com.amazonaws.serverless.proxy.struts2.echoapp; +package com.amazonaws.serverless.proxy.struts.echoapp; import com.amazonaws.serverless.proxy.RequestReader; import com.amazonaws.serverless.proxy.model.AwsProxyRequestContext; diff --git a/aws-serverless-java-container-struts/src/test/resources/struts.xml b/aws-serverless-java-container-struts/src/test/resources/struts.xml index 0c5dd8328..92070be83 100644 --- a/aws-serverless-java-container-struts/src/test/resources/struts.xml +++ b/aws-serverless-java-container-struts/src/test/resources/struts.xml @@ -7,7 +7,7 @@ - + message @@ -15,7 +15,7 @@ - diff --git a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/build.gradle b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/build.gradle index a2cb228b8..240979c70 100644 --- a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/build.gradle +++ b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/build.gradle @@ -13,7 +13,7 @@ configurations { dependencies { - implementation ('com.amazonaws.serverless:aws-serverless-java-container-struts2:[1.0,)') { + implementation ('com.amazonaws.serverless:aws-serverless-java-container-struts:[1.0,)') { exclude group: 'org.apache.struts', module: 'struts2-core' exclude group: 'org.apache.logging.log4j', module: 'log4j-api' exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j' diff --git a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/pom.xml b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/pom.xml index 19204eac7..e2957a69e 100644 --- a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/pom.xml +++ b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/pom.xml @@ -9,7 +9,7 @@ \${version} jar - Serverless Struts2 API + Serverless Struts API https://github.com/awslabs/aws-serverless-java-container @@ -24,7 +24,7 @@ com.amazonaws.serverless - aws-serverless-java-container-struts2 + aws-serverless-java-container-struts ${project.version} @@ -101,12 +101,6 @@ \${log4j.version} - - org.apache.logging.log4j - log4j-slf4j-impl - \${log4j.version} - - com.amazonaws aws-lambda-java-log4j2 diff --git a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/src/test/java/StreamLambdaHandlerTest.java b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/src/test/java/StreamLambdaHandlerTest.java index f429ce66b..12fc9fc07 100644 --- a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/src/test/java/StreamLambdaHandlerTest.java +++ b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/src/test/java/StreamLambdaHandlerTest.java @@ -7,7 +7,7 @@ import com.amazonaws.serverless.proxy.model.AwsProxyResponse; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.serverless.proxy.struts2.Struts2LambdaHandler; +import com.amazonaws.serverless.proxy.struts.StrutsLambdaHandler; import org.junit.BeforeClass; import org.junit.Test; @@ -26,12 +26,12 @@ public class StreamLambdaHandlerTest { - private static Struts2LambdaHandler handler; + private static StrutsLambdaHandler handler; private static Context lambdaContext; @BeforeClass public static void setUp() { - handler = new Struts2LambdaHandler(); + handler = new StrutsLambdaHandler(); lambdaContext = new MockLambdaContext(); } diff --git a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/template.yml b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/template.yml index 2025da620..fe446dedd 100644 --- a/aws-serverless-struts-archetype/src/main/resources/archetype-resources/template.yml +++ b/aws-serverless-struts-archetype/src/main/resources/archetype-resources/template.yml @@ -22,7 +22,7 @@ #set($awsRegion = $awsRegion.replaceAll("\n", "").trim()) AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 -Description: AWS Serverless Apache Struts2 API - ${groupId}::${artifactId} +Description: AWS Serverless Apache Struts API - ${groupId}::${artifactId} Globals: Api: EndpointConfiguration: REGIONAL @@ -31,7 +31,7 @@ Resources: ${resourceName}Function: Type: AWS::Serverless::Function Properties: - Handler: com.amazonaws.serverless.proxy.struts2.Struts2LambdaHandler::handleRequest + Handler: com.amazonaws.serverless.proxy.struts.StrutsLambdaHandler::handleRequest Runtime: java11 CodeUri: . MemorySize: 512 diff --git a/aws-serverless-struts-archetype/src/test/resources/projects/base/archetype.properties b/aws-serverless-struts-archetype/src/test/resources/projects/base/archetype.properties index d731ebe81..80acd0f43 100644 --- a/aws-serverless-struts-archetype/src/test/resources/projects/base/archetype.properties +++ b/aws-serverless-struts-archetype/src/test/resources/projects/base/archetype.properties @@ -1,3 +1,3 @@ groupId=test.service -artifactId=struts2-archetype-test +artifactId=struts-archetype-test version=1.0-SNAPSHOT diff --git a/samples/struts2/pet-store/README.md b/samples/struts/pet-store/README.md similarity index 91% rename from samples/struts2/pet-store/README.md rename to samples/struts/pet-store/README.md index 80ad76b6c..e421ac4e2 100644 --- a/samples/struts2/pet-store/README.md +++ b/samples/struts/pet-store/README.md @@ -1,5 +1,5 @@ -# Serverless Struts2 example -A basic pet store written with the [Apache Struts framework](https://struts.apache.org). The `Struts2LambdaHandler` object provided by the `aws-serverless-java-container-struts2` is the main entry point for Lambda. +# Serverless Struts example +A basic pet store written with the [Apache Struts framework](https://struts.apache.org). The `StrutsLambdaHandler` object provided by the `aws-serverless-java-container-struts` is the main entry point for Lambda. The application can be deployed in an AWS account using the [Serverless Application Model](https://github.com/awslabs/serverless-application-model). The `template.yml` file in the root folder contains the application definition @@ -29,7 +29,7 @@ Once the deployment is completed, the SAM CLI will print out the stack's outputs ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Outputs ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -Key Struts2PetStoreApi +Key StrutsPetStoreApi Description URL for application Value https://n60c1ycwa2.execute-api.eu-central-1.amazonaws.com/pets ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/samples/struts2/pet-store/build.gradle b/samples/struts/pet-store/build.gradle similarity index 100% rename from samples/struts2/pet-store/build.gradle rename to samples/struts/pet-store/build.gradle diff --git a/samples/struts2/pet-store/pom.xml b/samples/struts/pet-store/pom.xml similarity index 98% rename from samples/struts2/pet-store/pom.xml rename to samples/struts/pet-store/pom.xml index 562c8fb8f..4f0a1e8d5 100644 --- a/samples/struts2/pet-store/pom.xml +++ b/samples/struts/pet-store/pom.xml @@ -7,7 +7,7 @@ com.amazonaws.serverless.sample serverless-struts-example 1.0-SNAPSHOT - Struts2 example for the aws-serverless-java-container library + Struts example for the aws-serverless-java-container library Simple pet store written with the Apache Struts framework https://aws.amazon.com/lambda/ diff --git a/samples/struts2/pet-store/src/main/assembly/dist.xml b/samples/struts/pet-store/src/main/assembly/dist.xml similarity index 100% rename from samples/struts2/pet-store/src/main/assembly/dist.xml rename to samples/struts/pet-store/src/main/assembly/dist.xml diff --git a/samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/actions/PetsController.java b/samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/actions/PetsController.java similarity index 100% rename from samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/actions/PetsController.java rename to samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/actions/PetsController.java diff --git a/samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/Pet.java b/samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/Pet.java similarity index 100% rename from samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/Pet.java rename to samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/Pet.java diff --git a/samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/PetData.java b/samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/PetData.java similarity index 100% rename from samples/struts2/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/PetData.java rename to samples/struts/pet-store/src/main/java/com/amazonaws/serverless/sample/struts/model/PetData.java diff --git a/samples/struts2/pet-store/src/main/resources/log4j2.xml b/samples/struts/pet-store/src/main/resources/log4j2.xml similarity index 100% rename from samples/struts2/pet-store/src/main/resources/log4j2.xml rename to samples/struts/pet-store/src/main/resources/log4j2.xml diff --git a/samples/struts2/pet-store/src/main/resources/struts.xml b/samples/struts/pet-store/src/main/resources/struts.xml similarity index 100% rename from samples/struts2/pet-store/src/main/resources/struts.xml rename to samples/struts/pet-store/src/main/resources/struts.xml diff --git a/samples/struts2/pet-store/template.yml b/samples/struts/pet-store/template.yml similarity index 84% rename from samples/struts2/pet-store/template.yml rename to samples/struts/pet-store/template.yml index a3e794e9c..94902ac9f 100644 --- a/samples/struts2/pet-store/template.yml +++ b/samples/struts/pet-store/template.yml @@ -11,7 +11,7 @@ Resources: PetStoreFunction: Type: AWS::Serverless::Function Properties: - Handler: com.amazonaws.serverless.proxy.struts2.Struts2LambdaHandler::handleRequest + Handler: com.amazonaws.serverless.proxy.struts.StrutsLambdaHandler::handleRequest Runtime: java11 CodeUri: . MemorySize: 256 @@ -25,8 +25,8 @@ Resources: PayloadFormatVersion: '1.0' Outputs: - Struts2PetStoreApi: + StrutsPetStoreApi: Description: URL for application Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/pets' Export: - Name: Struts2PetStoreApi + Name: StrutsPetStoreApi