Skip to content

Commit

Permalink
[WFLY-18692] removes cdi from helloworld qs
Browse files Browse the repository at this point in the history
  • Loading branch information
emmartins committed Oct 26, 2023
1 parent 9e97917 commit 96b53ef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 87 deletions.
6 changes: 3 additions & 3 deletions helloworld/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ include::../shared-doc/attributes.adoc[]
= helloworld: Helloworld Example
:author: Pete Muir
:level: Beginner
:technologies: CDI, Servlet
:technologies: Servlet
:openshift: true

[abstract]
The `helloworld` quickstart demonstrates the use of CDI and Servlet 6 and is a good starting point to verify {productName} is configured correctly.
The `helloworld` quickstart demonstrates the use of Servlet 6 and is a good starting point to verify {productName} is configured correctly.

:standalone-server-type: default
:archiveType: war

== What is it?

The `helloworld` quickstart demonstrates the use of _CDI_ and _Servlet 6_ in {productNameFull} {productVersion}.
The `helloworld` quickstart demonstrates the use of _Servlet 6_ in {productNameFull} {productVersion}.

// System Requirements
include::../shared-doc/system-requirements.adoc[leveloffset=+1]
Expand Down
16 changes: 0 additions & 16 deletions helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,6 @@
</dependencyManagement>

<dependencies>

<!-- Import the CDI API, we use provided scope as the API is included in the server -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Import the Common Annotations API (JSR-250), we use provided scope
as the API is included in WildFly -->
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
</dependency>

<!-- Import the Servlet API, we use provided scope as the API is included in the server -->
<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@
*/
package org.jboss.as.quickstarts.helloworld;

import java.io.IOException;
import java.io.PrintWriter;

import jakarta.inject.Inject;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

/**
* <p>
* A simple servlet taking advantage of features added in 3.0.
* </p>
*
* <p>
* The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet
* @HttpServlet}. The {@link HelloService} is injected by CDI.
* @HttpServlet}.
* </p>
*
* @author Pete Muir
Expand All @@ -47,15 +42,12 @@ public class HelloWorldServlet extends HttpServlet {

static String PAGE_FOOTER = "</body></html>";

@Inject
HelloService helloService;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
writer.println(PAGE_HEADER);
writer.println("<h1>" + helloService.createHelloMessage("World") + "</h1>");
writer.println("<h1>Hello World!</h1>");
writer.println(PAGE_FOOTER);
writer.close();
}
Expand Down
23 changes: 0 additions & 23 deletions helloworld/src/main/webapp/WEB-INF/beans.xml

This file was deleted.

0 comments on commit 96b53ef

Please sign in to comment.