You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Jon Stevens <jo...@latchkey.com> on 2001/04/09 05:36:17 UTC

Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine/services/template TurbineTemplateService.java

on 4/8/01 8:33 PM, "Daniel Rall" <dl...@collab.net> wrote:

> Would you mind giving a quick description of why commas are replaced
> with slashes in the template name?  I think this would be a good
> addition to the JavaDoc.  Thanks!

This is because of the way that Turbine does its Parameter parsing of the
PATH_INFO:

Ie:

template/foo,bar.vm

On disk, that is "screens/foo/bar.vm" but the problem is if that same thing
was in the PATH_INFO, the name/value translation would be off. So, a "," is
used instead.

-jon


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


RE: cvs commit:jakarta-turbine/src/java/org/apache/turbine/services/templateTurbineTemplateService.java

Posted by Ilkka Priha <ip...@surfeu.fi>.
There's another poorly documented path problem also. I'm not sure, which
service should convert '/'s to File.separatorChars? Both the previous and
current versions of the TurbineTemplateService use only slashes and pass the
slashed path to the template engine service. However, the template service
provides a method for template engines to search for template files, which
simply converts the given paths to Files without modifications, so it's
likely to get back its own slashed paths and nobody performs the
transformation to system specific paths.

On the other hand, Velocity seems to convert paths given to its file
resource loader and  separated by back-slashes to slash separated paths and
pass them directly to the File constructor without concerning about
File.separatorChar. So it would be useless to give system specific paths to
at least Velocity, maybe Turbine can rely on slash separated paths as well?

-- Ilkka


> -----Original Message-----
> From: Jon Stevens [mailto:jon@latchkey.com]
> Sent: Monday, April 09, 2001 06:36
> To: turbine-dev
> Subject: Re: cvs
> commit:jakarta-turbine/src/java/org/apache/turbine/services/templateTurb
> ineTemplateService.java
>
>
> on 4/8/01 8:33 PM, "Daniel Rall" <dl...@collab.net> wrote:
>
> > Would you mind giving a quick description of why commas are replaced
> > with slashes in the template name?  I think this would be a good
> > addition to the JavaDoc.  Thanks!
>
> This is because of the way that Turbine does its Parameter parsing of the
> PATH_INFO:
>
> Ie:
>
> template/foo,bar.vm
>
> On disk, that is "screens/foo/bar.vm" but the problem is if that
> same thing
> was in the PATH_INFO, the name/value translation would be off.
> So, a "," is
> used instead.
>
> -jon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org