DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Using nice URL that describe the content of the site will not only improve your ranking but also look more appealling to the users on a SERP (search engine result page). In our case a common URL looks like that:
http://isport.eu/en/premier-league/liverpool-fc/news-19-2008-0.html![]()
where /en is the language, /premier-league is the currently selected league, /liverpool-fc is the club the page is about, /news are on the page, 19-2008 is the week and 0 is the current page.
...
In your application class add the following:h5
Wicket 1.5
| Code Block |
|---|
publicprotected WebResponse newInstancenewWebResponse(final WebRequest webRequest, final HttpServletResponse servletResponsehttpServletResponse){ { return new ServletWebResponse((ServletWebRequest) webRequest, servletResponsehttpServletResponse) { @Override public String encodeURL(CharSequence url) { return isRobot(webRequest) boolean isBotAgent = botUtil.getBotIdentifier() != null; ? url.toString() : super.encodeURL(url); } @Override public String encodeRedirectURL(CharSequence url) { return isBotAgentisRobot(webRequest) ? url.toString() : super.encodeURLencodeRedirectURL(url); } } private boolean isRobot(WebRequest request) { final String agent = webRequest.getHeader("User-Agent"); return /* use 'agent' to decide whether this is a bot */; } }; } |
...
Wicket 1.4
| Code Block |
|---|
@Override
protected WebResponse newWebResponse(final HttpServletResponse servletResponse) {
return new BufferedWebResponse(servletResponse) {
@Override
public CharSequence encodeURL(final CharSequence url) {
final String agent = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest().getHeader("User-Agent");
return isAgent(agent) ? url : super.encodeURL(url);
}
};
}
|
...