Discussions

J2EE patterns: Simplify websession-stored object handling

  1. Simplify websession-stored object handling (5 messages)

    A Servlet Controller (CoordinatorServlet) intercept HttpServlet request and instance a per-session coordinated object using the last in-URL folder.

    Example (/app/ = Controller invocation token):
    http://mysrv/myapp/app/mydir/test.jsp

    Calls-chain:
    -> Tomcat-> CoordinatorServlet.service()-> MydirCoord.contextualize()->test.jsp

    For every session exist only one MydirCoord instance.
    In this instance you can store per-user object references.

    For more infos:
    http://www.robertocolmegna.it/java/

    Threaded Messages (5)

  2. ??[ Go to top ]

    Run this through a coherence filter.
  3. seriously.
  4. ?[ Go to top ]

    It really makes no sense. Maby an UML diagram would help.
  5. This is same as the above frameworks.
  6. Servlet Filters[ Go to top ]

    I have seen many developers passing servlet request, response, ans session objects from method to method. This can be solved using a filter and thread locals. Create a servlet fileter, and an Thread local singleton ActionContext which stores request, response, session for current request. Let the filter set request, response, and session for current request in ActionContext. Now whenever any method needs to access any of the above objects it can call context.getRequest() context.getResponse() context.getSession() No need to pass this objects from method to method. Programming Ideas