diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/pom.xml b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/pom.xml new file mode 100644 index 000000000..2f8fe3c8e --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + org.jboss.intersmash + intersmash-deployments-shared-eap7 + 0.0.1-SNAPSHOT + ../pom.xml + + + eap7-helloworld + war + + Intersmash Shared Deployments (EAP 7): Hello World Quickstart + + + + + jakarta.inject + jakarta.inject-api + provided + + + + org.jboss.spec.javax.servlet + jboss-servlet-api_4.0_spec + provided + + + + + + + org.apache.maven.plugins + maven-war-plugin + + ROOT + + + + + diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java new file mode 100644 index 000000000..13d44f1e7 --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java @@ -0,0 +1,31 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.helloworld; + +/** + * A simple CDI service which is able to say hello to someone + * + * @author Pete Muir + * + */ +public class HelloService { + + String createHelloMessage(String name) { + return "Hello " + name + "!"; + } + +} diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java new file mode 100644 index 000000000..5942cfb9e --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java @@ -0,0 +1,62 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual + * contributors by the @authors tag. See the copyright.txt in the + * distribution for a full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jboss.as.quickstarts.helloworld; + +import java.io.IOException; +import java.io.PrintWriter; + +import javax.inject.Inject; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + *

+ * A simple servlet taking advantage of features added in 3.0. + *

+ * + *

+ * The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet + * @HttpServlet}. The {@link HelloService} is injected by CDI. + *

+ * + * @author Pete Muir + * + */ +@SuppressWarnings("serial") +@WebServlet("/HelloWorld") +public class HelloWorldServlet extends HttpServlet { + + static String PAGE_HEADER = "helloworld"; + + static String PAGE_FOOTER = ""; + + @Inject + HelloService helloService; + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + resp.setContentType("text/html"); + PrintWriter writer = resp.getWriter(); + writer.println(PAGE_HEADER); + writer.println("

" + helloService.createHelloMessage("World") + "

"); + writer.println(PAGE_FOOTER); + writer.close(); + } + +} diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/WEB-INF/beans.xml b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 000000000..1b3cc6c0e --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/index.html b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/index.html new file mode 100644 index 000000000..8e59c00ac --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/eap7-helloworld/src/main/webapp/index.html @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/pom.xml b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/pom.xml new file mode 100644 index 000000000..a8ab982d1 --- /dev/null +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-eap7/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + + org.jboss.intersmash + intersmash-deployments-shared + 0.0.1-SNAPSHOT + + pom + + intersmash-deployments-shared-eap7 + + + + 1.8 + 1.8 + UTF-8 + + 7.4.13.GA + + org.jboss.bom + jboss-eap-jakartaee8 + ${jboss-eap7.version} + + + + eap7-helloworld + + + + + + + ${bom.jboss-eap7-jakartaee.groupId} + ${bom.jboss-eap7jakartaee.artifactId} + ${bom.jboss-eap7-jakartaee.version} + pom + import + + + + \ No newline at end of file diff --git a/deployments/intersmash-deployments-shared/pom.xml b/deployments/intersmash-deployments-shared/pom.xml index e131de3e6..234dcefff 100644 --- a/deployments/intersmash-deployments-shared/pom.xml +++ b/deployments/intersmash-deployments-shared/pom.xml @@ -22,6 +22,7 @@ intersmash-deployments-shared-wildfly + intersmash-deployments-shared-eap7