Reputation: 16525
I have web application which have some web pages. Now I want to hide them when some attribute in my configuration will be false. With hide them I mean when someone write web page address there will be status not found. Is this possible in wicket ?
Upvotes: 2
Views: 160
Reputation: 7696
You can throw an AbortWithHttpErrorCodeException
in your page:
public HomePage(final PageParameters parameters) {
if(someConditionToHidePage) {
throw new AbortWithHttpErrorCodeException(404, "page not found");
}
}
Hope that helps
Upvotes: 5
Reputation: 2511
I don't think it's possible. You could build a custom Link component that get disabled if the attribute in your configuration it's false.
Upvotes: 0