This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Passing parameters to pages
Skip to end of metadata
Go to start of metadata

Passing Parameters (General)

Adding the parameters in your WebPage:

...

	PageParameters params = new PageParameters();
	params.put("param", "value");
	setResponsePage(PageToRetrieveParams.class, params);

...

Retrieving the parameters in your WebPage:

...

	public PageToRetrieveParams(PageParameters p) {
		p.getString("param");
	}

...

Passing Parameters (To Home Page)

In your WebApplication:

...

public Class<? extends WebPage> getHomePage() {
	return HomePage.class;
}

...

In your HomePage:

...

public HomePage() {
	// Check the current state of everything before passing the parameters
	if (state == WORLD) {
		throw new RestartResponseException(PageWeArePassingParamsTo.class, new PageParameters(...));
	}
}

...

Passing Parameters (Using RequestCycle)

Adding the parameters in your WebPage:

...

	RequestCycle.get().getPageParameters().put("myObject", myObect);

...

Retrieving the parameters in your WebPage:

...

	MyObject myObect = (MyObect)getWebRequestCycle().getPageParameters().get("myObject");

...
  • No labels