}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException {
ParticipantId id = sessionManager.getLoggedInUser(request.getSession(false));
// Eventually, it would be nice to show users who aren't logged in the public waves.
// However, public waves aren't implemented yet. For now, we'll just redirect users
// who haven't signed in to the sign in page.
if (id == null) {
response.sendRedirect(sessionManager.getLoginUrl("/"));
return;
}
AccountData account = sessionManager.getLoggedInAccount(request.getSession(false));
if (account != null) {
String locale = account.asHuman().getLocale();
if (locale != null) {
String requestLocale = UrlParameters.getParameters(request.getQueryString()).get("locale");
if (requestLocale == null) {
response.sendRedirect(UrlParameters.addParameter(request.getRequestURL().toString(), "locale", locale));
return;
}
}
}
String[] parts = id.getAddress().split("@");
String username = parts[0];
String userDomain = id.getDomain();
try {
WaveClientPage.write(response.getWriter(), new GxpContext(request.getLocale()),
getSessionJson(request.getSession(false)), getClientFlags(request), websocketPresentedAddress,
TopBar.getGxpClosure(username, userDomain), analyticsAccount);