On 9/25/01 1:31 PM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:

> "Gonzalo Diethelm" <[EMAIL PROTECTED]> writes:
> 
>> How can I get ahold of a RunData object from a function that is not an
>> Action or Screen method?  I need one of these objects, but I found
>> creating one of them was harder than I thought:
>> 
>> * Have to create some concrete implementation of the RunData
>>   interface; which one? (I tried with TurbineDefaultRunData).
> 
> TurbineRunDataService rds = (TurbineRunDataService)
>   TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME);
> RunData data = rds.getRunData(req, res, getServletConfig());

I definitely do not recommend this. I think John is right in that you should
place your functionality in a request independent class so you can use it
anywhere.

This will also be locked down in Turbine 3.x. The use of RunData objects
outside the context of the request lifecycle will be forbidden as it always
should have been. You are just going to get yourself into a further mess
binding your actions classes to RunData,
 
>> * The created RunData does not have a valid ParameterParser; have to
>>   create one by hand.
> 
> The PP is generally created from the request.
> 
>> * The created RunData gives errors for some operations, such as
>>   tool-related errors (don't have any of these handy).
> 
> The PullService may not have been called to populate your RunData w/
> persistent tools.
> 
>> Is there a recommended way to create or get ahold of a RunData
>> object? I believe Turbine manages some kind of pool for these, but
>> I'm not sure it is public... I see there is a RunDataService, but
>> it will only give back a RunData object given HttpServletRequest,
>> HttpServletResponse and ServletConfig objects; maybe what I'm
>> trying to do doesn't make any sense outside a servlet context?
> 
> The definition of a RunData is the encapsulation of a servlet's
> request and response.  Unfortunately, it appears to be quite tied to
> HTTP-related operations.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to