I commtted some changes yesterday that allow you to use ActionSupport
actions outside of the webwork servlet container.
Actually - I'm not sure about that. They allow you to use the actions
outside of the request/response paradigm is probably more accurate.
However you must create and destroy your own ActionContext each time you
call an action, replacing the old context at the end, otherwise the previou=
s
actions will lose their context. This is problematic because it prevents
long lived actions.
I have no idea how to solve it at the moment because of the ThreadLocal :)
The one workaround is to always create an execute your actions in one
method. I've attached a little ActionDispatcher class which I've created to
do this for JIRA (it's a bit of a hack at the moment - I'd love if this
could be better thought out and integrated into WW).
Usage is something like this:
ActionResult aResult =3D ActionDispatcher.execute("com.foo.bar.MyAction",
paramsMap);
This will create your action, set any params from the map, and then put the
results into aResult.
Is anyone else using WW actions outside of the request/response paradigm?
Cheers,
Mike
On 7/8/02 3:19 AM, "Patrick Lightbody" (pli...@ho...) penned the
words:
> So where does this stand? Also, is there going to be an announcement
> regarding 1.2 and OpenSymphony?
>=20
> -Pat
>=20
> ----- Original Message -----
> From: "Patrick Lightbody" <pli...@ho...>
> To: "Rickard" <ri...@dr...>
> Cc: "Mike Cannon-Brookes" <mi...@at...>;
> <web...@li...>
> Sent: Thursday, August 01, 2002 3:09 AM
> Subject: Re: [Webwork-user] problem with running ActionSupport based clas=
ses
> outside of webwork servlet container
>=20
>=20
>> Well, I think the first thing is to figure out what should be pulled out=
.
> I
>> think we pretty much know what that is. Basically, anything that has
> "Http"
>> or "Servlet" in it.
>>=20
>> Then the real trick is to figure out what should be put BACK in. Abstrac=
t
>> support for getRemoteUser is a must. I suppose some abstract support for
>> getParameter should also be there (ActionContext has getParameter alread=
y,
>> which is confusing me). What about sessions? Anything else?
>>=20
>> -Pat
>>=20
>> ----- Original Message -----
>> From: "Rickard" <ri...@dr...>
>> To: "Patrick Lightbody" <pli...@ho...>
>> Cc: "Mike Cannon-Brookes" <mi...@at...>;
>> <web...@li...>
>> Sent: Thursday, August 01, 2002 10:43 AM
>> Subject: Re: [Webwork-user] problem with running ActionSupport based
> classes
>> outside of webwork servlet container
>>=20
>>=20
>>> Patrick Lightbody wrote:
>>>> Well, for one, WebWork needs to completely remove itself from the
> "web".
>>>> This is WW-12 and is critical towards this goal. For example,
>>>> ActionContext.getRequest() returns an HttpSerlvetRequest object. All
> the
>>>> servlet stuff needs to be abstracted away and then allow for a
> pluggable
>>>> design that gives the developer the opportunity to dictate how
>>>> getRemoteUser() or getAttriute() or getParameter() behaves.
>>>=20
>>> True. The context stuff needs to be more modular and pluggable. I'm
>>> currently implementing the Portlet API (JSR168), and there's a bunch of
>>> stuff there that needs to be made available to the action(if used for
>>> Portlet implementation). The user is one of those things. But this
>>> should only be done if the action is actually used as a portlet. So, th=
e
>>> ActionContext stuff shouldn't be bloated unnecessarily. Not sure how to
>>> do this best...
>>>=20
>>> /Rickard
>>>=20
>>> --
>>> Rickard =D6berg
>>> Senselogic
>>>=20
>>=20
>>=20
>> -------------------------------------------------------
>> This sf.net email is sponsored by:ThinkGeek
>> Welcome to geek heaven.
>> http://thinkgeek.com/sf
>> _______________________________________________
>> Webwork-user mailing list
>> Web...@li...
>> https://lists.sourceforge.net/lists/listinfo/webwork-user
>>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Webwork-user mailing list
> Web...@li...
> https://lists.sourceforge.net/lists/listinfo/webwork-user
|