RE: [Actionframework-users] processing order suggestion
Status: Inactive
Brought to you by:
ptoman
From: Petr T. <Pet...@pi...> - 2003-05-15 13:35:29
|
> > 2) destroy() method of a component with "request" persistence that > implements Destroyed interface. >=20 > This is also good idea, but I have my actions bound to methods of > 'session' scoped component so I would have to create that special=20 > component from inside other component via as.getComponent() - which > seem little dirty to me. You can also create "request" component in <action>'s <post-invoke>. > I would really suggest to have something like <post-render-invoke> in > some future release. Good idea. Maybe adding some attribute to <post-invoke> would be a "softer" solution instead of introducing a new element. =20 > One more question/suggestion: It would be really nice to have some way > of accessing AS components from any class. I know that JNDI is planned, > that would be great! I was thinking about some class with static AS > component accessors, but I didn't succeed. Yes, JNDI will be a standard way to achieve this. At present, you=20 can create a class with static accessors. A simple example: public class MyServlet extends ActionServlet { private static MyServlet _self; public MyServlet() { if (_self !=3D null) throw new IllegalStateException("There seems to be " + "a problem with the servlet container's class loader"); _self =3D this; } public static Object getASComponent(...)=20 throws InstantiatorException { if (_self =3D=3D null) throw new IllegalStateException("ActionServlet was " + "not yet initialized"); return _self.getComponent(...); } } -Petr [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=3D22957959 ] |