@@ -0,0 +1,2698 @@
+/*%0A * JBoss, Home of Professional Open Source%0A * Copyright 2012, Red Hat, Inc. and/or its affiliates, and individual%0A * contributors by the @authors tag. See the copyright.txt in the%0A * distribution for a full listing of individual contributors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * http://www.apache.org/licenses/LICENSE-2.0%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jboss.as.quickstarts.hellosport;%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport java.util.Date;%0Aimport java.util.StringTokenizer;%0A%0Aimport javax.inject.Inject;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/**%0A * %3Cp%3E%0A * A simple servlet taking advantage of features added in 3.0.%0A * %3C/p%3E%0A *%0A * %3Cp%3E%0A * The servlet is registered and mapped to /HelloServlet using the %7B@linkplain WebServlet%0A * @HttpServlet%7D. The %7B@link HelloService%7D is injected by CDI.%0A * %3C/p%3E%0A *%0A * @author Pete Muir / Rick Stewart%0A *%0A */%0A@SuppressWarnings(%22serial%22)%0A@WebServlet(%22/HelloWorld%22)%0Apublic class HelloWorldServlet extends HttpServlet %7B%0A%0A   static String PAGE_HEADER = %22%3Chtml%3E%3Chead%3E%3Ctitle%3EHello from DLT Solutions%3C/title%3E%3Cbody%3E%22;%0A%0A   static String PAGE_FOOTER = %22%3C/body%3E%3C/html%3E%22;%0A%0A   @Inject%0A   HelloService helloService;%0A%0A   @Override%0A   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException %7B%0A%0A          int iDelay = 0;%0A%0A      resp.setContentType(%22text/html%22);%0A      PrintWriter writer = resp.getWriter();%0A%0A      if(req.getParameter(%22delay%22) != null)%0A      %7B%0A          try%0A          %7B%0A                  iDelay = Integer.valueOf(req.getParameter(%22delay%22));%0A          %7D%0A          catch(Exception e)%0A          %7B%0A                  //Do nothing and let delay = zero%0A          %7D%0A      %7D%0A%0A      writer.println(PAGE_HEADER);%0A      writer.println(%22This build can take an input parm and pass it to helloService for delay...%22);%0A      writer.println(%22%3Ch1%3E%22 + helloService.createHelloMessage(req.getHeader(%22x-forwarded-for%22), iDelay) + %22%3C/h1%3E%22);%0A      writer.println(%22%3Cp%3EDate / Time = %22+new Date().toString()+%22%3C/p%3E%22);%0A      writer.println(PAGE_FOOTER);%0A      writer.close();%0A   %7D%0A%0A%7D%0A

Create HelloWorldServlet.java