Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete version number in url

Tags:

How can I delete or hide the version number in the URL introduced in Wicket 1.5?

Mounting a page doesn't help.

http://localhost/MyPage/SubPage?0 
like image 331
rotsch Avatar asked Dec 22 '11 10:12

rotsch


1 Answers

In Application.init():

mount(new MountedMapperWithoutPageComponentInfo("/subpage", MyPage.class)); 

with the following Mapper class:

public class MountedMapperWithoutPageComponentInfo extends MountedMapper {    public MountedMapperWithoutPageComponentInfo(String mountPath, Class<? extends IRequestablePage> pageClass) {     super(mountPath, pageClass, new PageParametersEncoder());   }    @Override   protected void encodePageComponentInfo(Url url, PageComponentInfo info) {     // do nothing so that component info does not get rendered in url   }    @Override    public Url mapHandler(IRequestHandler requestHandler)    {        if (requestHandler instanceof ListenerInterfaceRequestHandler ||                 requestHandler instanceof BookmarkableListenerInterfaceRequestHandler) {            return null;        } else {             return super.mapHandler(requestHandler);        }    }  } 
like image 146
Apostolos Avatar answered Sep 22 '22 09:09

Apostolos