You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by green804 <gi...@fox.com> on 2007/11/07 22:55:54 UTC
UrlCodingStrategy with unmatched key/value pairs
I am having a problem with the UrlCodingStrategy. I'm currently extending
BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the app
is decoding some of the characters in the url before I get the url in the
decodeParameters method.
For example, the url once encoded looks like this:
/linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
When the decode method in BookmarkablePageRequestTargetUrlCodingStrategy
calls requestParameters.getPath() the url looks like this:
/linkframe/item/187822/site/Wine/sitetopic/Food/Drink
This is causing a problem because the app thinks the URL fragment has
unmatched key/value pairs. I cannot seem to find where/why the %2F is
getting resolved to a /. Can someone help me with this? I need to keep
this from happening. It's causing null pointers all over the place.
--
View this message in context: http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13636974
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: UrlCodingStrategy with unmatched key/value pairs
Posted by Gwyn Evans <gw...@gmail.com>.
As you're already overriding decodeParamaters(), what about a cut &
paste of the code from there & appendParameters(), changing it to use
some other character (that you won't have in your params), e.g. '|' or
'^', leaving the '/' to become a non-special char?
/Gwyn
On 07 November 2007, 10:09:57 PM, green804 wrote:
g> We are using 1.2.6 right now. The Food%2FDrink is one param. That param
g> does have a /. Unfortunately, I can't change the param. I'm overriding the
g> decodeParameters to handle the case with mismatched key/value pairs, but
g> it's kind of a hack because I have to know which params might have a /.
g> It's not a very generic solution. I'm hoping to track down where the decode
g> is happening in the first place and override that instead.
g> Johan Compagner wrote:
>>
>> what are you doing then in your own
>> BookmarkablePageRequestTargetUrlCodingStrategy?
>>
>> who generates that url? and what is that Food%2FDrink? Should that be 1
>> param? And has the param a /?
>>
>> which version do you use?
>>
>>
>> On 11/7/07, green804 <gi...@fox.com> wrote:
>>>
>>>
>>> I am having a problem with the UrlCodingStrategy. I'm currently
>>> extending
>>> BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the
>>> app
>>> is decoding some of the characters in the url before I get the url in the
>>> decodeParameters method.
>>>
>>> For example, the url once encoded looks like this:
>>>
>>> /linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
>>>
>>> where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
>>>
>>> When the decode method in BookmarkablePageRequestTargetUrlCodingStrategy
>>> calls requestParameters.getPath() the url looks like this:
>>>
>>> /linkframe/item/187822/site/Wine/sitetopic/Food/Drink
>>>
>>> This is causing a problem because the app thinks the URL fragment has
>>> unmatched key/value pairs. I cannot seem to find where/why the %2F is
>>> getting resolved to a /. Can someone help me with this? I need to keep
>>> this from happening. It's causing null pointers all over the place.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13636974
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: UrlCodingStrategy with unmatched key/value pairs
Posted by Johan Compagner <jc...@gmail.com>.
cant you just replace the / with a special char at the moment?
I even don't know how the current head/trunk handles this.. would be nice to
look at.
johan
On 11/7/07, green804 <gi...@fox.com> wrote:
>
>
> We are using 1.2.6 right now. The Food%2FDrink is one param. That param
> does have a /. Unfortunately, I can't change the param. I'm overriding
> the
> decodeParameters to handle the case with mismatched key/value pairs, but
> it's kind of a hack because I have to know which params might have a /.
> It's not a very generic solution. I'm hoping to track down where the
> decode
> is happening in the first place and override that instead.
>
>
>
> Johan Compagner wrote:
> >
> > what are you doing then in your own
> > BookmarkablePageRequestTargetUrlCodingStrategy?
> >
> > who generates that url? and what is that Food%2FDrink? Should that be 1
> > param? And has the param a /?
> >
> > which version do you use?
> >
> >
> > On 11/7/07, green804 <gi...@fox.com> wrote:
> >>
> >>
> >> I am having a problem with the UrlCodingStrategy. I'm currently
> >> extending
> >> BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the
> >> app
> >> is decoding some of the characters in the url before I get the url in
> the
> >> decodeParameters method.
> >>
> >> For example, the url once encoded looks like this:
> >>
> >> /linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
> >>
> >> where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
> >>
> >> When the decode method in
> BookmarkablePageRequestTargetUrlCodingStrategy
> >> calls requestParameters.getPath() the url looks like this:
> >>
> >> /linkframe/item/187822/site/Wine/sitetopic/Food/Drink
> >>
> >> This is causing a problem because the app thinks the URL fragment has
> >> unmatched key/value pairs. I cannot seem to find where/why the %2F is
> >> getting resolved to a /. Can someone help me with this? I need to
> keep
> >> this from happening. It's causing null pointers all over the place.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13636974
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13637200
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: UrlCodingStrategy with unmatched key/value pairs
Posted by green804 <gi...@fox.com>.
We are using 1.2.6 right now. The Food%2FDrink is one param. That param
does have a /. Unfortunately, I can't change the param. I'm overriding the
decodeParameters to handle the case with mismatched key/value pairs, but
it's kind of a hack because I have to know which params might have a /.
It's not a very generic solution. I'm hoping to track down where the decode
is happening in the first place and override that instead.
Johan Compagner wrote:
>
> what are you doing then in your own
> BookmarkablePageRequestTargetUrlCodingStrategy?
>
> who generates that url? and what is that Food%2FDrink? Should that be 1
> param? And has the param a /?
>
> which version do you use?
>
>
> On 11/7/07, green804 <gi...@fox.com> wrote:
>>
>>
>> I am having a problem with the UrlCodingStrategy. I'm currently
>> extending
>> BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the
>> app
>> is decoding some of the characters in the url before I get the url in the
>> decodeParameters method.
>>
>> For example, the url once encoded looks like this:
>>
>> /linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
>>
>> where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
>>
>> When the decode method in BookmarkablePageRequestTargetUrlCodingStrategy
>> calls requestParameters.getPath() the url looks like this:
>>
>> /linkframe/item/187822/site/Wine/sitetopic/Food/Drink
>>
>> This is causing a problem because the app thinks the URL fragment has
>> unmatched key/value pairs. I cannot seem to find where/why the %2F is
>> getting resolved to a /. Can someone help me with this? I need to keep
>> this from happening. It's causing null pointers all over the place.
>> --
>> View this message in context:
>> http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13636974
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13637200
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: UrlCodingStrategy with unmatched key/value pairs
Posted by Johan Compagner <jc...@gmail.com>.
what are you doing then in your own
BookmarkablePageRequestTargetUrlCodingStrategy?
who generates that url? and what is that Food%2FDrink? Should that be 1
param? And has the param a /?
which version do you use?
On 11/7/07, green804 <gi...@fox.com> wrote:
>
>
> I am having a problem with the UrlCodingStrategy. I'm currently extending
> BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the
> app
> is decoding some of the characters in the url before I get the url in the
> decodeParameters method.
>
> For example, the url once encoded looks like this:
>
> /linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
>
> where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
>
> When the decode method in BookmarkablePageRequestTargetUrlCodingStrategy
> calls requestParameters.getPath() the url looks like this:
>
> /linkframe/item/187822/site/Wine/sitetopic/Food/Drink
>
> This is causing a problem because the app thinks the URL fragment has
> unmatched key/value pairs. I cannot seem to find where/why the %2F is
> getting resolved to a /. Can someone help me with this? I need to keep
> this from happening. It's causing null pointers all over the place.
> --
> View this message in context:
> http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tf4767649.html#a13636974
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: UrlCodingStrategy with unmatched key/value pairs
Posted by w_user <de...@hotmail.com>.
Hello,
How can i override the decodeparameter(). I want to catch the
exception. The problem is that i have only the page class and the exception
is outside the page class
Here is my page class.
package de.rasselfisch.shop.web.page;
import java.text.NumberFormat;
import wicket.PageParameters;
import wicket.markup.html.WebPage;
import wicket.markup.html.link.BookmarkablePageLink;
import wicket.markup.html.link.Link;
import wicket.markup.html.panel.Panel;
import wicket.util.string.StringValueConversionException;
import de.rasselfisch.shop.dao.ArticleGroupDAO;
import de.rasselfisch.shop.dao.InventoryDAO;
import de.rasselfisch.shop.dao.pojo.ArticleGroup;
import de.rasselfisch.shop.dao.pojo.ConfigInventory;
import de.rasselfisch.shop.web.ApplicationSession;
import de.rasselfisch.shop.web.Basket;
import de.rasselfisch.shop.web.hibernate.HibernateApplication;
@SuppressWarnings("serial")
public class ArticlePage extends WebPage {
private String markup;
private Panel articleSelectPanel;
private boolean showPanel;
@SuppressWarnings("unused")
private String variation;
public char bas;
public ArticlePage() {
//Sets home page class. The class must be bookmarkable and must extend
Page.
setResponsePage(Basket.class);
}
/*
* PageParameters class has methods to get to the parameter value
* when supplied with the key.
*/
public ArticlePage(PageParameters pageParameters) {
}
public String getVariation() {
return this.markup;
}
public boolean isShowPanel() {
return showPanel;
}
public void setShowPanel(boolean showPanel) {
this.showPanel = showPanel;
}
}
Thanks for help!!!
green804 wrote:
>
> I am having a problem with the UrlCodingStrategy. I'm currently extending
> BookmarkablePageRequestTargetUrlCodingStrategy. The problem is that the
> app is decoding some of the characters in the url before I get the url in
> the decodeParameters method.
>
> For example, the url once encoded looks like this:
>
> /linkframe/item/187822/site/Wine/sitetopic/Food%2FDrink
>
> where the params are item=187822, site=Wine, and sitetopic=Food%2FDrink
>
> When the decode method in BookmarkablePageRequestTargetUrlCodingStrategy
> calls requestParameters.getPath() the url looks like this:
>
> /linkframe/item/187822/site/Wine/sitetopic/Food/Drink
>
> This is causing a problem because the app thinks the URL fragment has
> unmatched key/value pairs. I cannot seem to find where/why the %2F is
> getting resolved to a /. Can someone help me with this? I need to keep
> this from happening. It's causing null pointers all over the place.
>
--
View this message in context: http://www.nabble.com/UrlCodingStrategy-with-unmatched-key-value-pairs-tp13636974p18833180.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org