0 Replies Latest reply on Nov 25, 2008 2:46 PM by Gregory Nikle

    how to create seam servlet with EJB entitymanager?

    Gregory Nikle Apprentice
      I try to create fully functional seam servlet with EJB3.0 em.
      I read this artice: http://seamframework.org/Documentation/ReplacingServletsWithSeamResources

      Can anybody point step-by-step how to get what I want?

      1. I created class:

      public class MyResource extends AbstractResource {

          public String getResourcePath() {
              return "/myresource";

          public void getResource(final HttpServletRequest request, final HttpServletResponse response)
                  throws ServletException, IOException {

              new ContextualHttpServletRequest(request) {
                  public void process() throws IOException {
                      doWork(request, response);

          private void doWork(HttpServletRequest request, HttpServletResponse response) {
             // Component.getInstance(...);

      and added to components.xml

      '<web:context-filter url-pattern="/servlet/*" />'

      what to do next?
      Do I need to write?

          </servlet-mapping> `

      my app is called by http:localhost:8080/app/
      how to call my servlet?