Reputation: 1979
I want to have something like the following.
<head>
<% if deployment == true %>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<% else %>
<script src="js/lib/ref/jquery-1.6.2.js"></script>
<% endif %>
</head>
How can I do this in wicket?
Update:
Sorry, I was simplifying. Actually I want to include this just before the close body tag.
Upvotes: 1
Views: 655
Reputation: 3899
You can make your WebPage class implement the IHeaderContributer interface.
Then your class can override the following method
public void renderHeader(IHeaderResponse response) {
if (deployment) {
response.renderJavascriptReference("https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js");
}
else {
response.renderJavascriptReference("js/lib/ref/jquery-1.6.2.js");
}
Upvotes: 3