*
*/
private void sendStatusPage(Request req, Response res) {
byte[] bytes;
try {
OutputBuffer ob = getOutputBuffer(res);
// Replace locale specific Strings
String localHtml = replaceTokens(statusHtml, bundle);
// Replace state token
String status = getStateMsg().getI18NKey();
try {
// Try to get a localized version of this key
status = bundle.getString(status);
} catch (MissingResourceException ex) {
// Use the non-localized String version of the status
status = getStateMsg().toString();
}
String locationUrl = req.getScheme()
+ "://" + req.getServerName()
+ ':' + req.getServerPort() + "/login.jsf";
localHtml = localHtml.replace(REDIRECT_TOKEN, locationUrl);
bytes = localHtml.replace(STATUS_TOKEN, status).getBytes("UTF-8");
res.setContentLength(bytes.length);
ob.write(bytes, 0, bytes.length);
ob.flush();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}