On Mon, Sep 20, 2010 at 3:12 PM, Peter Karich <peat...@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 <peat...@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 <peat...@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-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >>
> >
>
>
> --
> http://jetwick.com twitter search prototype
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to