Hi Andrea,

On Fri, Oct 29, 2021 at 2:28 PM Andrea Del Bene <an.delb...@gmail.com>
wrote:

> In my current project I'm building a web app which is essentially made of
> pages mounted at a precise path which I guess it's a quite common design
> pattern with Wicket and web apps in general. Shortly after starting to work
> on this project I was asked to get rid of the page id to make page urls
> more "clean".
>

So, the issue is purely eastetic ?!


> This is something that it's relatively easy to achieve, and it has also
> been discussed different times on StackOverflow and on our mailing list.
> Essentially we have to create a custom MountedMapper overriding
> encodePageComponentInfo in order to skip pageInfo. Something like:
>
> public class NoPageIdMapper extends MountedMapper {
>
> @Override
> protected void encodePageComponentInfo(Url url, PageComponentInfo info) {
>      if (info.getComponentInfo() != null) {
>            super.encodePageComponentInfo(url, info);
>       }
>    }
> }
>

Wouldn't it be better to use only stateless components and behaviors ?
With NoPageIdMapper you just hide "the problem" but later some
functionality might break because of this.


>
> I've also found that some popular Wicket projects like OneDev or Orienteer
> adopt a similar solution. So I'm starting to wonder if we should consider
> to provide a standard solution for those who are interested in this kind of
> behavior.
>
> WDYT?
>

I've never used NoPageIdMapper in a real app, so I am not sure how stable
solution it is.


>
> --
> Andrea Del Bene.
> Apache Wicket committer.
>

Reply via email to