I want to have so开发者_开发技巧mething 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.
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");
}
精彩评论