On 10/3/01 10:40 AM, "Santiago Gala" <[EMAIL PROTECTED]> wrote:
> In fact TurbineResources.getService().getString( variable ). I have
> checked this patch and it works.
>
> This is the patch. Just ignore the System.err.println(), they are for
> debugging.
Ok, I will double check with the TDK sample app and than apply the patch.
> cvs server: Diffing src/java/org/apache/turbine/services/resources
> Index:
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/resources/Tur
> bineResourceService.java,v
> retrieving revision 1.4
> diff -c -r1.4 TurbineResourceService.java
> ***
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
> 2001/09/25 02:18:171.4
> ---
> src/java/org/apache/turbine/services/resources/TurbineResourceService.java
> 2001/10/03 14:36:35 ***************
> *** 223,233 ****
> --- 223,238 ----
>
> protected String interpolate(String base)
> {
> + System.err.print( "Resources: Interpolating " );
> + System.err.println( base );
> if (base == null)
> {
> return null;
> }
>
> + //Get the full ResourceService (we could be in a subset instance)
> + ResourceService top = TurbineResources.getService();
> +
> int begin = -1;
> int end = -1;
> int prec = 0-END_TOKEN.length();
> ***************
> *** 240,248 ****
> {
> result.append(base.substring(prec+END_TOKEN.length(),begin));
> variable = base.substring(begin+START_TOKEN.length(),end);
> ! if (configuration.get(variable)!=null)
> {
> ! result.append(configuration.get(variable));
> }
> prec=end;
> }
> --- 245,255 ----
> {
> result.append(base.substring(prec+END_TOKEN.length(),begin));
> variable = base.substring(begin+START_TOKEN.length(),end);
> ! System.err.print("Variable " + variable + " = " );
> ! System.err.println( top.getString(variable) );
> ! if (top.getString(variable)!=null)
> {
> ! result.append(top.getString(variable));
> }
> prec=end;
> }
>
>>>>>
>>>>> the interpolation code, possibly using a rootResources local var to
>>>>> store the result of the constant calls.
>>>>>
>>>>> What do you think?
>>>>>
>>>> I don't know yet :-)
>>>>
>>>>
>>>>> I think the third possibility is the simplest, as the first one is
>>>>> tricky WRT dynamic resources, and the second is slow and complex. The
>>>>> third one implies that all variables will be interpolated in the same
>>>>> way by all TurbineResourceService instances, which looks like a "nice"
>>>>> behaviour.
>>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> 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]