@@ -0,0 +1,1597 @@
+package jeex.web.servlets;%0A%0Aimport jeex.ejb.beans.TopicManagerLocal;%0Aimport jeex.ejb.domain.Topic;%0A%0Aimport javax.ejb.EJB;%0Aimport javax.ejb.ObjectNotFoundException;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0Aimport java.io.Writer;%0A%0A@WebServlet(%22/topic%22)%0Apublic class TopicServlet extends HttpServlet %7B%0A   @EJB%0A   private TopicManagerLocal ejb;%0A%0A   protected void doGet(HttpServletRequest request, HttpServletResponse response)%0A         throws ServletException, IOException %7B%0A      response.setContentType(%22text/html; charset=UTF-8%22);%0A      Writer out = response.getWriter();%0A%0A      out.append(%22%3C!doctype html%3E%22);%0A      out.append(%22%3Chtml lang=%5C%22en%5C%22%3E%22);%0A      out.append(%22%3Ctitle%3ETopic%3C/title%3E%22);%0A%0A      String idParam = request.getParameter(%22id%22);%0A%0A      try %7B%0A         long id = Long.parseLong(idParam);%0A         Topic topic = ejb.find(id);%0A         out.append(%22Topic name: %22);%0A         out.append(topic.getName());%0A      %7D catch (NumberFormatException e) %7B%0A         out.append(idParam == null ? %22Please specify id%22 : %22The specified id is not a valid number%22);%0A      %7D catch (ObjectNotFoundException e) %7B%0A         out.append(%22Topic could not be found%22);%0A      %7D%0A%0A      out.append(%22%3C/html%3E%22);%0A   %7D%0A%0A   protected void doPost(HttpServletRequest request, HttpServletResponse response)%0A         throws ServletException, IOException %7B%0A      response.sendError(HttpServletResponse.SC_BAD_REQUEST);%0A   %7D%0A%7D%0A

Add TopicServlet