I'm using Turbine 2.1 with velocity and have a question
concerning valid URLs.

After reviewing some of the turbine/velocity code, and doing some tests,
the following URL works:

../servlet/turbine?template=/bank/checking,AccountView.vm

My directory structure looks like:
/templates
/templates/bank
/templates/bank/checking
/templates/bank/checking/AccountView.vm


However, the velocity-site-howto.html seems to imply that the following
URL should also work:

../servlet/turbine/template/bank/checking/AccountView.vm

Is this actually the case??  This does NOT work for me, and if it should
then I know I need to keep digging.

The code in the DefaultParameterParser class picks the URL apart using
this snippet.  It attempts to make PathInfo look like a query string.
But it doesnt look right to me.

-----------------------------------------------------
    // Also cache any pathinfo variables that are passed around as
         // if they are query string data.
         try
         {
             StringTokenizer st = new StringTokenizer(req.getPathInfo(), "/");
             boolean name = true;
             String pathPart = null;
             while(st.hasMoreTokens())
             {
                 if ( name == true )
                 {
                     tmp = JServUtils.URLDecode(st.nextToken());
                     name = false;
                 }
                 else
                 {
                     pathPart = JServUtils.URLDecode(st.nextToken());
                     if ( tmp.length() != 0 )
                     {
                         add (convert(tmp), pathPart);
                     }
                     name = true;
                 }
             }
-----------------------------------------------------

I don't see how tokenizing using "/" will get you the correct answer.
You will end up with template=bank, which is incorrect.

What am I missing here????

Thanks...

J


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

Reply via email to