cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <>
Subject The Abomination that is RequestFactory
Date Thu, 04 Jul 2002 15:05:39 GMT
Since the RequestFactory class keeps an instance of the selected request
factory in a private static variable, different cocoon webapps in the
same classloader can not have different request factories.

I tried to fix this, but then I came across this line in

    public Object get(String name) {
        return RequestFactory.getRequestFactory(null).get(this.req,

And I haven't been able to figure out what to do from here. The
HttpServletRequest should have a reference to the factory used to create
the embedded req. Or something.

The ugly part is that the request factory isn't creating anything with a
get() method, instead relying on the factory's get() method to extract
the object.

Any pointers on how to proceed are welcome.

One idea is this:
  Extend HttpServletRequest with a class that has a get() method. 
   public class ObjectHttpServletRequest extends HttpServletRequest {
       public Object get(String name);
  Have the request factory return instances of that type instead. 
    public abstract ObjectHttpServletRequest getServletRequest( ...
  Then rework the HttpServletRequest to call that get method.
     return this.req.get(name);

Any major problems with the above?


To unsubscribe, e-mail:
For additional commands, email:

View raw message