package org.jboss.as.quickstarts.helloworld; import java.io.IOException; import java.io.PrintWriter; import javax.inject.Inject; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @SuppressWarnings("serial") @WebServlet("/Shop") public class ShopServlet extends HttpServlet { static String PAGE_HEADER = ""; static String PAGE_FOOTER = ""; @Inject SuggestionService suggestionService; @Inject ShoppingCart shoppingCart; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter writer = resp.getWriter(); writer.print(PAGE_HEADER); writer.print("

" + shoppingCart.getId() + " " + suggestionService.retrieveSuggestions() + "

"); writer.print(PAGE_FOOTER); writer.close(); } }