protected void doPost( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
bzb = new BooksZenBooks( "en", dbConfigResource ); // @TODO language should be a request param
String forwardUrl;
String pageTitle;
RequestDispatcher dispatcher;
User user;
int userId = RequestHelper.getInt( "userId", request );
/* Load necessary lexicons */
bzb.getLexicon().load( "global" );
bzb.getLexicon().load( "subject" );
if( bzb.getAuthenticatedUser( request ) == null ) {
bzb.getLexicon().load( "error" );
forwardUrl = jspPath + "401.jsp";
pageTitle = bzb.getLexicon().get( "unauthorized" );
}
else {
bzb.getLexicon().load( "profile" );
bzb.getLexicon().load( "book" );
bzb.getLexicon().load( "search" );
user = getUser( userId );
forwardUrl = jspPath + "displayUser.jsp";
pageTitle = bzb.getLexicon().get( "viewingProfile", new String[][]{ { "user", user.getEmail() } } );
request.setAttribute( "user", user );
request.setAttribute( "stats", getUserStats( userId ) );
request.setAttribute( "listings", getUserListings( userId ) );
}