You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fergal Keating <fe...@directski.com> on 2012/05/01 18:02:33 UTC
JsessionID breaking my DropDownChoice#onSelectionChanged
Apologies if this has been covered before, but i havn't found anything with
this specific issue.
I have a Dropdown added to my code, but when a user first accesses the
site, the URL gets appended with JsessionID. This seems to break the link,
and the #onSelectionChanged never gets called. Is there any way to prevent
this?
When i select initially it calls
http://localhost:8080/;jsessionid=1ftbjrge1ri51hpybjnwcuhe5?0-1.IFormSubmitListener-headerPanel-content-localePanel-form
and the page just reloads.
I want my code to work with JSessionID so I can support lack of cookies up
to a point. has there been any workaround for this?
DROPDOWN CODE
DropDownChoice<String> listSites = new
DropDownChoice<String>("localeSelect", new PropertyModel<String>(this,
"selected"), currentProductLocales)
{
private static final long serialVersionUID = 1L;
protected boolean wantOnSelectionChangedNotifications()
{return true;}
protected void onSelectionChanged(final String newSelection)
{
List<LocaleCurrency> ListofLocalesCurrency = new
ArrayList<LocaleCurrency>();
ListofLocalesCurrency =
productController.getCurrencyCountry(MyAuthenticatedWebSession.get().getProduct());
List<String> currentProductLocales = new ArrayList<String>();
for (LocaleCurrency localeCurrency : ListofLocalesCurrency)
{
if (selected.equals(localeCurrency.getDisplayName()))
{
MyAuthenticatedWebSession.get().setLocalCurrency(localeCurrency);
localeCurrency.setDefaultLocale();
}
}
;
}
};
Re: JsessionID breaking my DropDownChoice#onSelectionChanged
Posted by Fergal Keating <fe...@directski.com>.
Hi,
I havn't been able to recreate with a quickstart. Not sure why its
appending the sessionID.
#getContextRelativeUrl() is getting called correctly. So it must be
elsewhere in application. I'll keep looking.
Fergal.
On 1 May 2012 18:21, Sven Meier <sv...@meiers.net> wrote:
> Hi,
>
> I just verified with blocked cookies on a quickstart and it works fine
> here.
>
> ServletWebRequest#**getContextRelativeUrl() strips the session id from
> the uri, so running without cookies should be no problem.
>
> Perhaps something else is going wrong, you should build a quickstart and
> attach it to a JIRA issue.
>
> Sven
>
>
> On 05/01/2012 06:02 PM, Fergal Keating wrote:
>
>> Apologies if this has been covered before, but i havn't found anything
>> with
>> this specific issue.
>>
>> I have a Dropdown added to my code, but when a user first accesses the
>> site, the URL gets appended with JsessionID. This seems to break the link,
>> and the #onSelectionChanged never gets called. Is there any way to prevent
>> this?
>>
>> When i select initially it calls
>> http://localhost:8080/;**jsessionid=**1ftbjrge1ri51hpybjnwcuhe5?0-1.**
>> IFormSubmitListener-**headerPanel-content-**localePanel-form<http://localhost:8080/;jsessionid=1ftbjrge1ri51hpybjnwcuhe5?0-1.IFormSubmitListener-headerPanel-content-localePanel-form>
>>
>> and the page just reloads.
>>
>> I want my code to work with JSessionID so I can support lack of cookies up
>> to a point. has there been any workaround for this?
>>
>>
>> DROPDOWN CODE
>> DropDownChoice<String> listSites = new
>> DropDownChoice<String>("**localeSelect", new PropertyModel<String>(this,
>> "selected"), currentProductLocales)
>> {
>> private static final long serialVersionUID = 1L;
>>
>> protected boolean wantOnSelectionChangedNotifica**tions()
>> {return true;}
>>
>> protected void onSelectionChanged(final String newSelection)
>> {
>> List<LocaleCurrency> ListofLocalesCurrency = new
>> ArrayList<LocaleCurrency>();
>> ListofLocalesCurrency =
>> productController.**getCurrencyCountry(**MyAuthenticatedWebSession.get(**
>> ).getProduct());
>>
>> List<String> currentProductLocales = new ArrayList<String>();
>>
>> for (LocaleCurrency localeCurrency : ListofLocalesCurrency)
>> {
>>
>> if (selected.equals(**localeCurrency.getDisplayName(**)))
>> {
>> MyAuthenticatedWebSession.get(**).setLocalCurrency(**localeCurrency);
>> localeCurrency.**setDefaultLocale();
>> }
>>
>> }
>> ;
>> }
>> };
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Fergal Keating
IT Senior Engineer
-----------------------------------------------
e. fergal.keating@directski.com
p. NA
w. www.directski.com
Re: JsessionID breaking my DropDownChoice#onSelectionChanged
Posted by Sven Meier <sv...@meiers.net>.
Hi,
I just verified with blocked cookies on a quickstart and it works fine here.
ServletWebRequest#getContextRelativeUrl() strips the session id from the
uri, so running without cookies should be no problem.
Perhaps something else is going wrong, you should build a quickstart and
attach it to a JIRA issue.
Sven
On 05/01/2012 06:02 PM, Fergal Keating wrote:
> Apologies if this has been covered before, but i havn't found anything with
> this specific issue.
>
> I have a Dropdown added to my code, but when a user first accesses the
> site, the URL gets appended with JsessionID. This seems to break the link,
> and the #onSelectionChanged never gets called. Is there any way to prevent
> this?
>
> When i select initially it calls
> http://localhost:8080/;jsessionid=1ftbjrge1ri51hpybjnwcuhe5?0-1.IFormSubmitListener-headerPanel-content-localePanel-form
>
> and the page just reloads.
>
> I want my code to work with JSessionID so I can support lack of cookies up
> to a point. has there been any workaround for this?
>
>
> DROPDOWN CODE
> DropDownChoice<String> listSites = new
> DropDownChoice<String>("localeSelect", new PropertyModel<String>(this,
> "selected"), currentProductLocales)
> {
> private static final long serialVersionUID = 1L;
>
> protected boolean wantOnSelectionChangedNotifications()
> {return true;}
>
> protected void onSelectionChanged(final String newSelection)
> {
> List<LocaleCurrency> ListofLocalesCurrency = new
> ArrayList<LocaleCurrency>();
> ListofLocalesCurrency =
> productController.getCurrencyCountry(MyAuthenticatedWebSession.get().getProduct());
>
> List<String> currentProductLocales = new ArrayList<String>();
>
> for (LocaleCurrency localeCurrency : ListofLocalesCurrency)
> {
>
> if (selected.equals(localeCurrency.getDisplayName()))
> {
> MyAuthenticatedWebSession.get().setLocalCurrency(localeCurrency);
> localeCurrency.setDefaultLocale();
> }
>
> }
> ;
> }
> };
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org