You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Peter Karich <pe...@yahoo.de> on 2010/09/16 11:30:57 UTC

Url parameters: removed onClick + wrong url encoding

Hi,

two questions:

1. If I do the following all url parameters will be replaced with
?wicket:interface=:6:1:::

e.g. in the main wicket application class I do:
mount(new MixedParamUrlCodingStrategy("search", HomePage.class, new
String[]{"q"}));

in HomePage.java i do without ajax:
add(new Link("nextPage") {
  public void onClick() {
     // update some components
  }});

How can I avoid that search?q=test which correctly appears after a
search [1], will be overwritten with search?wicket:interface=:6:1::: ?
I would like that the user can copy and paste the url to a friend and he
can use the search (of course a new session is created + some parameters
lost but the q parameter is ok). So why not:
search?wicket:interface=:6:1:::&q=test


2. How can I use the HybridUrlCodingStrategy?
I am doing:
mount(new HybridUrlCodingStrategy("search", HomePage.class, true)); and
the problem is that searches containing hashes destroy the url or the
encoding does not work properly. So it writes the following url:

  search/q/#wicket.2
  instead of
  search/q/%23wicket.4

I searched through the code of that strategy but I think, that the
strategy works ok (it calls encode() when adding to url).
In the search form I am doing the appended code [1] and this works
correctly for other strategies.

Where could be my mistake? Wicket version: 1.4.9

Regards,
Peter.



[1]
Form form = new Form("searchform") {
   public void onSubmit() {
      PageParameters params = new PageParameters();
      if (query != null && !query.isEmpty())
           params.add("q", query);

      setResponsePage(HomePage.class, params);
   }};

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Url parameters: removed onClick + wrong url encoding

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Sep 20, 2010 at 8:57 PM, Peter Karich <pe...@yahoo.de> wrote:

> Hi Martin!
>
> >> Martin,
> >>
> >> thanks for the support in the tickets btw :-)
> >>
> >>
> > We thank you for testing the framework and blogging about it! ;-)
> >
>
> ;-)
>
> > Interesting.
> > How exactly looks the URL for such request?
>
> E.g. try it with the quickstart at:
> https://issues.apache.org/jira/browse/WICKET-3053
>
> http://localhost:8080/jetwick/?test
> (it seems that 'test' can anything)
>
> Directory: /jetwick/
> WEB-INF/  <http://localhost:8080/jetwick/WEB-INF/>      4096 bytes
> 16.09.2010 22:18:08
>
> Looks like a bug in HomePageMapper.
I'll create the ticket.
Thanks !

>
> luckily clicking the WEB-INF doesn't show its content and maybe this
> issue is as well a jetty one.
>
> > StringValue is a "clever" class ;-)
> > It can handle "null" value for you.
> > It has isNull(), isEmpty()
>
> oh noo, that simple ... :-)
>
> Regards,
> Peter.
>

Re: Url parameters: removed onClick + wrong url encoding

Posted by Peter Karich <pe...@yahoo.de>.
Hi Martin!

>> Martin,
>>
>> thanks for the support in the tickets btw :-)
>>
>>     
> We thank you for testing the framework and blogging about it! ;-)
>   

;-)

> Interesting.
> How exactly looks the URL for such request?

E.g. try it with the quickstart at:
https://issues.apache.org/jira/browse/WICKET-3053

http://localhost:8080/jetwick/?test
(it seems that 'test' can anything)

Directory: /jetwick/
WEB-INF/  <http://localhost:8080/jetwick/WEB-INF/> 	4096 bytes 
16.09.2010 22:18:08


luckily clicking the WEB-INF doesn't show its content and maybe this
issue is as well a jetty one.

> StringValue is a "clever" class ;-)
> It can handle "null" value for you.
> It has isNull(), isEmpty()

oh noo, that simple ... :-)

Regards,
Peter.

Re: Url parameters: removed onClick + wrong url encoding

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Sep 20, 2010 at 3:12 PM, Peter Karich <pe...@yahoo.de> wrote:

> Martin,
>
> thanks for the support in the tickets btw :-)
>
We thank you for testing the framework and blogging about it! ;-)

>
> two minor migration questions (when using 1.5-M2.1)
>
> 1. When I mount my homepage via:
> getRootRequestMapperAsCompound().add(new MountedMapper("twittersearch",
> HomePage.class));
> and I am querying webapp/?test I got a directory listing - is this
> intended behaviour?
>
Interesting.
How exactly looks the URL for such request?

>
> 2. I am doing a lot of
> String str = pageParameters.getString("q");
> if(str != null && !str.isEmpty()) { // using str...
> }
>
> Now the method is replaced with get("q").toString() and when dealing
> with optional parameters it now looks a lot more verbose:
> StringValue sv = pageParameters.get("q");
> if(sv != null) {
>    String str = sv.toString()
>    if(!str.isEmpty()) { // using str...
>    }
> }
> Can I avoid that?
>
StringValue is a "clever" class ;-)
It can handle "null" value for you.
It has isNull(), isEmpty()

>
> Regards,
> Peter.
>
> > On Thu, Sep 16, 2010 at 9:11 PM, Peter Karich <pe...@yahoo.de> wrote:
> >
> >
> >> Thanks Martin for your time and help!
> >>
> >> The problem with M2.1 is that some functionality is missing/hidden:
> >> E.g. I need
> >> getWebRequestCycle().getWebRequest()
> >> to guess the user language and set some caching stuff to workaround an
> >> ajax+backbutton problem in 1.4.9.
> >>
> >>
> > In components you can use org.apache.wicket.Component.getRequest()
> > Otherwise: RequestCycle.get().getRequest() and WebRequest,
> > ServletWebRequest, custom
> >
> >
> >> Is this the correct way to use MountedMapper
> >> getRootRequestMapperAsCompound().add(new MountedMapper("search",
> >> HomePage.class));
> >> ?
> >>
> >>
> > Yes.
> >
> >
> >> But the blocker was guice, it seems to be broken (does not inject my
> >> Provider => NPE) when using the 1.4.9 approach:
> >> addComponentInstantiationListener(
> >>        new GuiceComponentInjector(this, Guice.createInjector(new
> >> DefaultModule())));
> >>
> >>
> > See wicket-examples > Guice (
> >
> http://wicketstuff.org/wicket/guice/wicket/bookmarkable/org.apache.wicket.examples.guice.HomePage
> > )
> > They work. Find the differences ;-)
> >
> >
> >> I found the migration guide but could not solve the problems above
> >>
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5
> >>
> >>
> > If you find something to add there don't hesitate to press the "Edit"
> link
> > at the top ;-)
> >
> >
> >> Regards,
> >> Peter.
> >>
> >>
> >>
> >>> On Thu, Sep 16, 2010 at 4:05 PM, Peter Karich <pe...@yahoo.de>
> wrote:
> >>>
> >>>
> >>>
> >>>> Hi Martin!
> >>>>
> >>>>
> >>>>
> >>>>>> The answer here is to use HybridUCS. It preserves the 'nice' url.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
> >>>>>
> >>>>>
> >>>>>
> >>>> did you mean this one:
> >>>>
> >>>> http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/
> >>>>
> >>>>
> >>>>
> >>> Yes, see
> >>> Artifacts:
> >>> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/dist<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> >>>
> >> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> >>
> >>> Maven repo:
> >>> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/m2-repo<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
> >>>
> >> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
> >>
> >>>
> >>>
> >>>> are there any major problems with that version?
> >>>>
> >>>>
> >>>>
> >>> Probably, it is not final yet. But I don't know of anything major.
> >>>
> >>>
> >>>
> >>>>
> >>>>> There the URL handling is much easier.
> >>>>>
> >>>>>
> >>>> What in detail is better with URL handling? It works better 'out of
> the
> >>>> box'?
> >>>>
> >>>> The UrlCodingStrategies are replaced with IReuqestHandlers which are
> >>>>
> >> much
> >>
> >>>>
> >>> more easier to extend, read, write, ...
> >>> For your case see MountedMapper.
> >>>
> >>>
> >>>
> >>>>> I'm not sure where is the problem here. I'll need to try it myself
> ...
> >>>>> Please create a ticket in Jira with a quickstart. Maybe it is a bug.
> >>>>>
> >>>>>
> >>>>>
> >>>> ok, I can reproduce it with 1.4.9. see:
> >>>> https://issues.apache.org/jira/browse/WICKET-3052
> >>>>
> >>>> Please let me know if you can reproduce it too or if I did something
> >>>> other wrong.
> >>>>
> >>>>
> >>>>
> >>> Ok. Some of us will take a look.
> >>> Thanks!
> >>>
> >>>
> >>>
> >>>> Regards,
> >>>> Peter.
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >>
> >
>
>
> --
> http://jetwick.com twitter search prototype
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Url parameters: removed onClick + wrong url encoding

Posted by Peter Karich <pe...@yahoo.de>.
Martin,

thanks for the support in the tickets btw :-)

two minor migration questions (when using 1.5-M2.1)

1. When I mount my homepage via:
getRootRequestMapperAsCompound().add(new MountedMapper("twittersearch",
HomePage.class));
and I am querying webapp/?test I got a directory listing - is this
intended behaviour?

2. I am doing a lot of
String str = pageParameters.getString("q");
if(str != null && !str.isEmpty()) { // using str...
}

Now the method is replaced with get("q").toString() and when dealing
with optional parameters it now looks a lot more verbose:
StringValue sv = pageParameters.get("q");
if(sv != null) {
    String str = sv.toString()
    if(!str.isEmpty()) { // using str...
    }
}
Can I avoid that?

Regards,
Peter.

> On Thu, Sep 16, 2010 at 9:11 PM, Peter Karich <pe...@yahoo.de> wrote:
>
>   
>> Thanks Martin for your time and help!
>>
>> The problem with M2.1 is that some functionality is missing/hidden:
>> E.g. I need
>> getWebRequestCycle().getWebRequest()
>> to guess the user language and set some caching stuff to workaround an
>> ajax+backbutton problem in 1.4.9.
>>
>>     
> In components you can use org.apache.wicket.Component.getRequest()
> Otherwise: RequestCycle.get().getRequest() and WebRequest,
> ServletWebRequest, custom
>
>   
>> Is this the correct way to use MountedMapper
>> getRootRequestMapperAsCompound().add(new MountedMapper("search",
>> HomePage.class));
>> ?
>>
>>     
> Yes.
>
>   
>> But the blocker was guice, it seems to be broken (does not inject my
>> Provider => NPE) when using the 1.4.9 approach:
>> addComponentInstantiationListener(
>>        new GuiceComponentInjector(this, Guice.createInjector(new
>> DefaultModule())));
>>
>>     
> See wicket-examples > Guice (
> http://wicketstuff.org/wicket/guice/wicket/bookmarkable/org.apache.wicket.examples.guice.HomePage
> )
> They work. Find the differences ;-)
>
>   
>> I found the migration guide but could not solve the problems above
>> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5
>>
>>     
> If you find something to add there don't hesitate to press the "Edit" link
> at the top ;-)
>
>   
>> Regards,
>> Peter.
>>
>>
>>     
>>> On Thu, Sep 16, 2010 at 4:05 PM, Peter Karich <pe...@yahoo.de> wrote:
>>>
>>>
>>>       
>>>> Hi Martin!
>>>>
>>>>
>>>>         
>>>>>> The answer here is to use HybridUCS. It preserves the 'nice' url.
>>>>>>
>>>>>>
>>>>>>             
>>>>> Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
>>>>>
>>>>>
>>>>>           
>>>> did you mean this one:
>>>>
>>>> http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/
>>>>
>>>>
>>>>         
>>> Yes, see
>>> Artifacts:
>>> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/dist<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
>>>       
>> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
>>     
>>> Maven repo:
>>> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/m2-repo<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
>>>       
>> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
>>     
>>>
>>>       
>>>> are there any major problems with that version?
>>>>
>>>>
>>>>         
>>> Probably, it is not final yet. But I don't know of anything major.
>>>
>>>
>>>       
>>>>         
>>>>> There the URL handling is much easier.
>>>>>
>>>>>           
>>>> What in detail is better with URL handling? It works better 'out of the
>>>> box'?
>>>>
>>>> The UrlCodingStrategies are replaced with IReuqestHandlers which are
>>>>         
>> much
>>     
>>>>         
>>> more easier to extend, read, write, ...
>>> For your case see MountedMapper.
>>>
>>>
>>>       
>>>>> I'm not sure where is the problem here. I'll need to try it myself ...
>>>>> Please create a ticket in Jira with a quickstart. Maybe it is a bug.
>>>>>
>>>>>
>>>>>           
>>>> ok, I can reproduce it with 1.4.9. see:
>>>> https://issues.apache.org/jira/browse/WICKET-3052
>>>>
>>>> Please let me know if you can reproduce it too or if I did something
>>>> other wrong.
>>>>
>>>>
>>>>         
>>> Ok. Some of us will take a look.
>>> Thanks!
>>>
>>>
>>>       
>>>> Regards,
>>>> Peter.
>>>>
>>>>         
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>   


-- 
http://jetwick.com twitter search prototype


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Url parameters: removed onClick + wrong url encoding

Posted by Peter Karich <pe...@yahoo.de>.
Hi Martin!

>> Thanks Martin for your time and help!
>>
>> The problem with M2.1 is that some functionality is missing/hidden:
>> E.g. I need
>> getWebRequestCycle().getWebRequest()
>> to guess the user language and set some caching stuff to workaround an
>> ajax+backbutton problem in 1.4.9.
>>
>>     
> In components you can use org.apache.wicket.Component.getRequest()
> Otherwise: RequestCycle.get().getRequest() and WebRequest,
> ServletWebRequest, custom
ok, I will take a look at this.

> See wicket-examples > Guice (
> http://wicketstuff.org/wicket/guice/wicket/bookmarkable/org.apache.wicket.examples.guice.HomePage
> )
> They work. Find the differences ;-)
>   

Hmmh, the example doesn't use modules, setters for injection or
providers ... I will digg into and raise another Jira issue if it's not
my fault ;-)

>> I found the migration guide but could not solve the problems above
>> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5
>>
>>     
> If you find something to add there don't hesitate to press the "Edit" link
> at the top ;-)

If I only could provide a solution :-)

Regards,
Peter.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Url parameters: removed onClick + wrong url encoding

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Sep 16, 2010 at 9:11 PM, Peter Karich <pe...@yahoo.de> wrote:

> Thanks Martin for your time and help!
>
> The problem with M2.1 is that some functionality is missing/hidden:
> E.g. I need
> getWebRequestCycle().getWebRequest()
> to guess the user language and set some caching stuff to workaround an
> ajax+backbutton problem in 1.4.9.
>
In components you can use org.apache.wicket.Component.getRequest()
Otherwise: RequestCycle.get().getRequest() and WebRequest,
ServletWebRequest, custom

>
> Is this the correct way to use MountedMapper
> getRootRequestMapperAsCompound().add(new MountedMapper("search",
> HomePage.class));
> ?
>
Yes.

>
> But the blocker was guice, it seems to be broken (does not inject my
> Provider => NPE) when using the 1.4.9 approach:
> addComponentInstantiationListener(
>        new GuiceComponentInjector(this, Guice.createInjector(new
> DefaultModule())));
>
See wicket-examples > Guice (
http://wicketstuff.org/wicket/guice/wicket/bookmarkable/org.apache.wicket.examples.guice.HomePage
)
They work. Find the differences ;-)

>
> I found the migration guide but could not solve the problems above
> https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5
>
If you find something to add there don't hesitate to press the "Edit" link
at the top ;-)

>
> Regards,
> Peter.
>
>
> > On Thu, Sep 16, 2010 at 4:05 PM, Peter Karich <pe...@yahoo.de> wrote:
> >
> >
> >> Hi Martin!
> >>
> >>
> >>>> The answer here is to use HybridUCS. It preserves the 'nice' url.
> >>>>
> >>>>
> >>> Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
> >>>
> >>>
> >> did you mean this one:
> >>
> >> http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/
> >>
> >>
> > Yes, see
> > Artifacts:
> > http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/dist<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> > Maven repo:
> > http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/m2-repo<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
> <http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
> >
> >
> >> are there any major problems with that version?
> >>
> >>
> > Probably, it is not final yet. But I don't know of anything major.
> >
> >
> >>
> >>> There the URL handling is much easier.
> >>>
> >> What in detail is better with URL handling? It works better 'out of the
> >> box'?
> >>
> >> The UrlCodingStrategies are replaced with IReuqestHandlers which are
> much
> >>
> > more easier to extend, read, write, ...
> > For your case see MountedMapper.
> >
> >
> >>> I'm not sure where is the problem here. I'll need to try it myself ...
> >>> Please create a ticket in Jira with a quickstart. Maybe it is a bug.
> >>>
> >>>
> >> ok, I can reproduce it with 1.4.9. see:
> >> https://issues.apache.org/jira/browse/WICKET-3052
> >>
> >> Please let me know if you can reproduce it too or if I did something
> >> other wrong.
> >>
> >>
> > Ok. Some of us will take a look.
> > Thanks!
> >
> >
> >> Regards,
> >> Peter.
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Url parameters: removed onClick + wrong url encoding

Posted by Peter Karich <pe...@yahoo.de>.
Thanks Martin for your time and help!

The problem with M2.1 is that some functionality is missing/hidden:
E.g. I need
getWebRequestCycle().getWebRequest()
to guess the user language and set some caching stuff to workaround an
ajax+backbutton problem in 1.4.9.

Is this the correct way to use MountedMapper
getRootRequestMapperAsCompound().add(new MountedMapper("search",
HomePage.class));
?

But the blocker was guice, it seems to be broken (does not inject my
Provider => NPE) when using the 1.4.9 approach:
addComponentInstantiationListener(
        new GuiceComponentInjector(this, Guice.createInjector(new
DefaultModule())));

I found the migration guide but could not solve the problems above
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5

Regards,
Peter.


> On Thu, Sep 16, 2010 at 4:05 PM, Peter Karich <pe...@yahoo.de> wrote:
>
>   
>> Hi Martin!
>>
>>     
>>>> The answer here is to use HybridUCS. It preserves the 'nice' url.
>>>>
>>>>         
>>> Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
>>>
>>>       
>> did you mean this one:
>>
>> http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/
>>
>>     
> Yes, see
> Artifacts:
> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/dist<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
> Maven repo:
> http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/m2-repo<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>
>
>   
>> are there any major problems with that version?
>>
>>     
> Probably, it is not final yet. But I don't know of anything major.
>
>   
>>     
>>> There the URL handling is much easier.
>>>       
>> What in detail is better with URL handling? It works better 'out of the
>> box'?
>>
>> The UrlCodingStrategies are replaced with IReuqestHandlers which are much
>>     
> more easier to extend, read, write, ...
> For your case see MountedMapper.
>
>   
>>> I'm not sure where is the problem here. I'll need to try it myself ...
>>> Please create a ticket in Jira with a quickstart. Maybe it is a bug.
>>>
>>>       
>> ok, I can reproduce it with 1.4.9. see:
>> https://issues.apache.org/jira/browse/WICKET-3052
>>
>> Please let me know if you can reproduce it too or if I did something
>> other wrong.
>>
>>     
> Ok. Some of us will take a look.
> Thanks!
>
>   
>> Regards,
>> Peter.
>>     


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Url parameters: removed onClick + wrong url encoding

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Sep 16, 2010 at 4:05 PM, Peter Karich <pe...@yahoo.de> wrote:

> Hi Martin!
>
> >> The answer here is to use HybridUCS. It preserves the 'nice' url.
> >>
> > Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
> >
>
> did you mean this one:
>
> http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/
>
Yes, see
Artifacts:
http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/dist<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/dist>
Maven repo:
http://people.apache.org/~ivaynberg/wicket-1.5-M2.1/m2-repo<http://people.apache.org/%7Eivaynberg/wicket-1.5-M2.1/m2-repo>

>
> are there any major problems with that version?
>
Probably, it is not final yet. But I don't know of anything major.

>
> > There the URL handling is much easier.
>
> What in detail is better with URL handling? It works better 'out of the
> box'?
>
> The UrlCodingStrategies are replaced with IReuqestHandlers which are much
more easier to extend, read, write, ...
For your case see MountedMapper.

> > I'm not sure where is the problem here. I'll need to try it myself ...
> > Please create a ticket in Jira with a quickstart. Maybe it is a bug.
> >
>
> ok, I can reproduce it with 1.4.9. see:
> https://issues.apache.org/jira/browse/WICKET-3052
>
> Please let me know if you can reproduce it too or if I did something
> other wrong.
>
Ok. Some of us will take a look.
Thanks!

>
> Regards,
> Peter.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Url parameters: removed onClick + wrong url encoding

Posted by Peter Karich <pe...@yahoo.de>.
Hi Martin!

>> The answer here is to use HybridUCS. It preserves the 'nice' url.
>>     
> Or use Wicket 1.5 (M2.1). There the URL handling is much easier.
>   

did you mean this one:

http://svn.apache.org/repos/asf/wicket/branches/wicket-1.5-M2/

are there any major problems with that version?

> There the URL handling is much easier.

What in detail is better with URL handling? It works better 'out of the
box'?

> I'm not sure where is the problem here. I'll need to try it myself ...
> Please create a ticket in Jira with a quickstart. Maybe it is a bug.
>   

ok, I can reproduce it with 1.4.9. see:
https://issues.apache.org/jira/browse/WICKET-3052

Please let me know if you can reproduce it too or if I did something
other wrong.

Regards,
Peter.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Url parameters: removed onClick + wrong url encoding

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Sep 16, 2010 at 11:30 AM, Peter Karich <pe...@yahoo.de> wrote:

> Hi,
>
> two questions:
>
> 1. If I do the following all url parameters will be replaced with
> ?wicket:interface=:6:1:::
>
> e.g. in the main wicket application class I do:
> mount(new MixedParamUrlCodingStrategy("search", HomePage.class, new
> String[]{"q"}));
>
> in HomePage.java i do without ajax:
> add(new Link("nextPage") {
>  public void onClick() {
>     // update some components
>  }});
>
> How can I avoid that search?q=test which correctly appears after a
> search [1], will be overwritten with search?wicket:interface=:6:1::: ?
> I would like that the user can copy and paste the url to a friend and he
> can use the search (of course a new session is created + some parameters
> lost but the q parameter is ok). So why not:
> search?wicket:interface=:6:1:::&q=test
>
> The answer here is to use HybridUCS. It preserves the 'nice' url.
Or use Wicket 1.5 (M2.1). There the URL handling is much easier.

>
> 2. How can I use the HybridUrlCodingStrategy?
> I am doing:
> mount(new HybridUrlCodingStrategy("search", HomePage.class, true)); and
> the problem is that searches containing hashes destroy the url or the
> encoding does not work properly. So it writes the following url:
>
>  search/q/#wicket.2
>  instead of
>  search/q/%23wicket.4
>
> I searched through the code of that strategy but I think, that the
> strategy works ok (it calls encode() when adding to url).
> In the search form I am doing the appended code [1] and this works
> correctly for other strategies.
>
I'm not sure where is the problem here. I'll need to try it myself ...
Please create a ticket in Jira with a quickstart. Maybe it is a bug.

>
> Where could be my mistake? Wicket version: 1.4.9
>
> Regards,
> Peter.
>
>
>
> [1]
> Form form = new Form("searchform") {
>   public void onSubmit() {
>      PageParameters params = new PageParameters();
>      if (query != null && !query.isEmpty())
>           params.add("q", query);
>
>      setResponsePage(HomePage.class, params);
>   }};
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>