class JigsawHttpServletRequest {
public String getServerName() {
String host = request.getHost();
if (host != null) {
int idx = host.lastIndexOf(':');
if (idx != -1) {
return host.substring(0, host.lastIndexOf(':'));
} else {
return host;
}
} else {
return getServer().getHost();
}
}
}
class JigsawHttpServletRequest {
/**
* Returns the preferred <code>Locale</code> that the client will
* accept content in, based on the Accept-Language header.
* If the client request doesn't provide an Accept-Language header,
* this method returns the default locale for the server.
*
* @return the preferred <code>Locale</code> for the client
*/
public Locale getLocale() {
return (Locale)getLocales().nextElement();
}
}