hudi
hudi

Reputation: 16525

How to control web page using parameters separate with slash in wicket

I want to create some wicket web page where I will use slash delimeter. Main page will be:

http://some.url/team/ 

will display list of team (Here I just mount wicket web page to team)

but now I have no idea how to do it in wicket. Url:

http://some.url/team/id/330/

should show detail of team with id 330 and

http://some.url/team/id/330/edit/ 

should show edit form to edit information about this tournament

Upvotes: 2

Views: 170

Answers (1)

JimmyJames
JimmyJames

Reputation: 1403

You can do something like this in your WebApplication class:

mount(new MountedMapper("/team/id/${id}", TeamPage.class));
mount(new MountedMapper("/team/id/${id}/edit", TeamEdit.class));

Then in the WebPage class:

public TeamPage(PageParameters params){
    String teamId = params.get("id").toString();
}

Upvotes: 1

Related Questions