Skip to content

Commit

Permalink
Fix more ws
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Jun 25, 2011
1 parent d7eb2af commit 075a732
Showing 1 changed file with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* </p>
*
* <p>
* The servlet is registered and mapped to /HelloServlet using the
* {@linkplain WebServlet @HttpServlet}. The {@link HelloService} is injected by
* CDI.
* The servlet is registered and mapped to /HelloServlet using the {@linkplain WebServlet
* @HttpServlet}. The {@link HelloService} is injected by CDI.
* </p>
*
* @author pmuir
Expand All @@ -28,22 +27,20 @@
@WebServlet("/HelloWorld")
public class HelloWorldServlet extends HttpServlet {

static String PAGE_HEADER = "<html><head /><body>";
static String PAGE_HEADER = "<html><head /><body>";

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

@Inject
HelloService helloService;
@Inject
HelloService helloService;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
PrintWriter writer = resp.getWriter();
writer.println(PAGE_HEADER);
writer.println("<h1>" + helloService.createHelloMessage("World")
+ "</h1>");
writer.println(PAGE_FOOTER);
writer.close();
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter writer = resp.getWriter();
writer.println(PAGE_HEADER);
writer.println("<h1>" + helloService.createHelloMessage("World") + "</h1>");
writer.println(PAGE_FOOTER);
writer.close();
}

}

0 comments on commit 075a732

Please sign in to comment.