J2EE patterns: Simplify websession-stored object handling
A Servlet Controller (CoordinatorServlet) intercept HttpServlet request and instance a per-session coordinated object using the last in-URL folder.
- Posted by: Roberto Colmegna
- Posted on: August 19 2004 09:59 EDT
Example (/app/ = Controller invocation token):
-> 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:
- ?? by Dave C on August 20 2004 11:16 EDT
- Simplify websession-stored object handling by William Perez on August 30 2004 08:50 EDT
- ? by vacariuc lucian on September 17 2004 18:37 EDT
- Same as Struts/ UIX/ JSF Frameworks by Afkham Azeez on November 01 2004 04:42 EST
Run this through a coherence filter.
It really makes no sense. Maby an UML diagram would help.
This is same as the above frameworks.
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