Skip to content

Commit

Permalink
Documentation updated for WICKET-6498
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Del Bene committed Feb 7, 2018
1 parent c6c17fe commit c7f6040
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions wicket-user-guide/src/main/asciidoc/resources/resources_8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,11 @@ The following code is taken from the Application class of the project:
@Override
public void init()
{
setHeaderResponseDecorator(new JavaScriptToBucketResponseDecorator("footer-container"));
setHeaderResponseDecorator(response -> {
return new ResourceAggregator(new JavaScriptFilteredIntoFooterHeaderResponse(response, "footer-container"));
});
}

/**
* Decorates an original IHeaderResponse and renders all javascript items
* (JavaScriptHeaderItem), to a specific container in the page.
*/
static class JavaScriptToBucketResponseDecorator implements IHeaderResponseDecorator
{

private String bucketName;

public JavaScriptToBucketResponseDecorator(String bucketName) {
this.bucketName = bucketName;
}

@Override
public IHeaderResponse decorate(IHeaderResponse response) {
return new JavaScriptFilteredIntoFooterHeaderResponse(response, bucketName);
}

}
----
As you can see in the code above the _bucket_ that will contain JavaScript tags is called _footer-container_ To make a use of it the developer have to add a special component called _HeaderResponseContainer_ in his page:
Expand Down

0 comments on commit c7f6040

Please sign in to comment.