For "file specifications" and "pathinfo" digested by the servlet context use
normal slashes.

For "files specifications" digested by Turbine (i.e. templates) use commas.

For "class specifications" digested by Turbine (i.e. actions) use full-stops
(aka: periods, dots, '.').

Here is an example URL construction in a velocity form:
<form method="post"
action="$link.setPage("foo,HelloWorld.vm").setAction("bar.Test")">
...
</form>

The resulting action URL in the form is something like:
http://localhost:8080/test/servlet/test/template/foo,HelloWorld.vm/action/ba
r.Test

The pathinfo set by the servlet context is
"template/foo,HelloWorld.vm/action/foo.Test". Turbine then comes along and
treats the pathinfo as a series of name/value pairs and stuffs them into the
query parameters:
template=foo,HelloWorld.vm
action=bar.Test

The Turbine velocity service translates the commas in the template file
specification to the appropriate file separator and then gets the real path
to the template (taking into consideration the value of
services.VelocityService.file.resource.loader.path in TR props).

Actions are class names, so Turbine must load them. The path separator in a
Java class specification [aka a Java package] is a full-stop. Turbine uses
the value of module.packages in TR props to help locate classes. So for an
action, Turbine looks in: {module.packages}.actions.{action}  (Note: I
believe that the "actions" component in the path is hardcoded into the
Turbine core logic). You may specify more that one {module.packages} in TR
props in which case Turbine searchs them in the order that they appear for
the class in question. Thus, in the example above, assuming that
module.packages is set to org.fmridc.test.modules in TR props, Turbine will
attempt to load the class: org.fmridc.test.modules.actions.bar.Test  Note
that the "package" directive in Test.java must be "package
org.fmridc.test.modules.actions.bar".


I your example:

> .setAction("content,content,SaveTopic")

Should be .setAction("content.content.SaveTopic"), and SaveTopic.java should
have a package directive of "package
{module.packages}.actions.content.content" [where {module.packages} is
specified in your TR props].



-Jeff Woodward
 Project Manager - Systems and Systems Integration
 The fMRI Data Center
 Dartmouth College
 6162 Moore Hall
 [EMAIL PROTECTED]


----- Original Message -----
From: "Scott Eade" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 8:11 AM
Subject: comma, slash, full-stop path directory delimiters.


> I am sure that while debugging one day I came across
> some code that indicated that the preferred delimiter
> for directory names was the comma and that the use
> of a slash would entail additional processing.
>
> Quite by accident today I changed the delimiter of an
> action from this:
>
> .setAction("content.SaveTopic")
>
> to this:
>
> .setAction("content,content,SaveTopic")
>
> (note that the extra "content" directory was the real
> change I wanted to make.  Unfortunately the use of
> commas resulted in the action not being found -
> here is the exception:
>
>  Exception:  java.lang.ClassNotFoundException:
>  at
org.apache.turbine.modules.ActionLoader.getInstance(ActionLoader.java:174)
>  at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
>  at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:143)
>  at org.apache.turbine.modules.Page.build(Page.java:90)
>  at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
>  at org.apache.turbine.Turbine.doGet(Turbine.java:447)
>  at org.apache.turbine.Turbine.doPost(Turbine.java:537)
>
> What is the deal with path delimiters?  I have seen
> comma, slash and full-stop used seemingly inconsistently.
> Do the different delimiters have different meanings?
> Which ones should I be using?  Obviously not commas
> for actions.
>
> Thanks,
>
> Scott
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to