You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Scott Merritt <SM...@abilizer.com> on 2001/10/05 02:12:02 UTC

addPathInfo vs addQueryData

How come each time I use addPathInfo from a template like...

$link.setPage("ItemList.vm").addPathInfo("cat_id", "7")

I get something back like:

http://myhost.com/app/servlet/app/template/ItemList.vm/cat_id/7

When I really want:

http://myhost.com/app/servlet/app/template/ItemList.vm?cat_id=7

It seems like from the Javadocs it should work the way I want.  addQueryData
works fine but it bothers me that I'm not doing it the way the example
shows.

What am I overlookin'?

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


Re: addPathInfo vs addQueryData

Posted by John McNally <jm...@collab.net>.
Well, what I said "that turbine treats the two the same" is still true. 
But I need to qualify that the webserver/servlet engine may treat a
couple characters specially / and ? are special characters and when used
in a the pathinfo (even in encoded form) they can cause problems.  I
assume the webserver is converting the %3F to ? and then declaring the
rest of the url following it as query data.  You would think the fact
that it is encoded would signal the fact that it should not be
interpreted the same as a ? character, but careful reading the http spec
shows it to be the proper procedure.

john mcnally

Roel Derksen wrote:
> 
> > The difference between using addPathInfo vs. addQueryData is obvious
> > from your example.  Turbine treats the 2 urls exactly the same.
> 
> I must say i have doubts about this.
> 
> I've got the following situation:
> I'm trying to put together a webmail application and i'm using the UID of
> the message to get it out of the mail folder.
> 
> First I've used addPathInfo to add the UID in the URL. It looked like this:
> <a
> href=$link.setPage("Message.vm").setAction("ShowMailbox").addPathInfo("messa
> geid",$entry.mUid)>View</a>
> This worked fine for most messages, except for one message. With this
> perticular message the messageid parameter wasn't available in ShowMailbox.
> The UID of this message is: ?D0"!X8S!!P%4!!D[T"!
> The URL after using the link is:
> ../ShowMailbox/messageid/%3FD0%22%21X8S%21%21P%254%21%21D%5BT%22%21
> 
> When I use addQuerryData there's no problem with passing messageid to
> ShowMailbox.
> The URL after using the link is:
> ../ShowMailbox?messageid=%3FD0%22%21X8S%21%21P%254%21%21D%5BT%22%21
> 
> So maybe there's a difference in the way the links are handled by turbine.
> (read bug).
> Or could it be a Browser problem ?
> 
> Greetings Roel
> 
> > The
> > main reason for this was that search engines (at least at some time in
> > the past, do not know if this is still accurate for the various
> > indexers) do not index urls with query data.  If your site includes a
> > catalog of items possibly for sale, it is possible that you might want
> > the site indexed.  If you are not concerned with this or you are
> > specifically trying to avoid the search engines from various pages using
> > query data is fine.
> >
> > john mcnally
> >
> > Scott Merritt wrote:
> > >
> > > How come each time I use addPathInfo from a template like...
> > >
> > > $link.setPage("ItemList.vm").addPathInfo("cat_id", "7")
> > >
> > > I get something back like:
> > >
> > > http://myhost.com/app/servlet/app/template/ItemList.vm/cat_id/7
> > >
> > > When I really want:
> > >
> > > http://myhost.com/app/servlet/app/template/ItemList.vm?cat_id=7
> > >
> > > It seems like from the Javadocs it should work the way I want.
> addQueryData
> > > works fine but it bothers me that I'm not doing it the way the example
> > > shows.
> > >
> > > What am I overlookin'?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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


Re: addPathInfo vs addQueryData

Posted by Roel Derksen <r....@zx.nl>.
> The difference between using addPathInfo vs. addQueryData is obvious
> from your example.  Turbine treats the 2 urls exactly the same.

I must say i have doubts about this.

I've got the following situation:
I'm trying to put together a webmail application and i'm using the UID of
the message to get it out of the mail folder.

First I've used addPathInfo to add the UID in the URL. It looked like this:
<a
href=$link.setPage("Message.vm").setAction("ShowMailbox").addPathInfo("messa
geid",$entry.mUid)>View</a>
This worked fine for most messages, except for one message. With this
perticular message the messageid parameter wasn't available in ShowMailbox.
The UID of this message is: ?D0"!X8S!!P%4!!D[T"!
The URL after using the link is:
../ShowMailbox/messageid/%3FD0%22%21X8S%21%21P%254%21%21D%5BT%22%21

When I use addQuerryData there's no problem with passing messageid to
ShowMailbox.
The URL after using the link is:
../ShowMailbox?messageid=%3FD0%22%21X8S%21%21P%254%21%21D%5BT%22%21

So maybe there's a difference in the way the links are handled by turbine.
(read bug).
Or could it be a Browser problem ?


Greetings Roel


> The
> main reason for this was that search engines (at least at some time in
> the past, do not know if this is still accurate for the various
> indexers) do not index urls with query data.  If your site includes a
> catalog of items possibly for sale, it is possible that you might want
> the site indexed.  If you are not concerned with this or you are
> specifically trying to avoid the search engines from various pages using
> query data is fine.
>
> john mcnally
>
> Scott Merritt wrote:
> >
> > How come each time I use addPathInfo from a template like...
> >
> > $link.setPage("ItemList.vm").addPathInfo("cat_id", "7")
> >
> > I get something back like:
> >
> > http://myhost.com/app/servlet/app/template/ItemList.vm/cat_id/7
> >
> > When I really want:
> >
> > http://myhost.com/app/servlet/app/template/ItemList.vm?cat_id=7
> >
> > It seems like from the Javadocs it should work the way I want.
addQueryData
> > works fine but it bothers me that I'm not doing it the way the example
> > shows.
> >
> > What am I overlookin'?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>




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


Re: addPathInfo vs addQueryData

Posted by John McNally <jm...@collab.net>.
The difference between using addPathInfo vs. addQueryData is obvious
from your example.  Turbine treats the 2 urls exactly the same.  The
main reason for this was that search engines (at least at some time in
the past, do not know if this is still accurate for the various
indexers) do not index urls with query data.  If your site includes a
catalog of items possibly for sale, it is possible that you might want
the site indexed.  If you are not concerned with this or you are
specifically trying to avoid the search engines from various pages using
query data is fine.

john mcnally

Scott Merritt wrote:
> 
> How come each time I use addPathInfo from a template like...
> 
> $link.setPage("ItemList.vm").addPathInfo("cat_id", "7")
> 
> I get something back like:
> 
> http://myhost.com/app/servlet/app/template/ItemList.vm/cat_id/7
> 
> When I really want:
> 
> http://myhost.com/app/servlet/app/template/ItemList.vm?cat_id=7
> 
> It seems like from the Javadocs it should work the way I want.  addQueryData
> works fine but it bothers me that I'm not doing it the way the example
> shows.
> 
> What am I overlookin'?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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