public class GetCurrentUser extends ActionAdapter { private IWebContext webContext; private User user; public GetCurrentUser() { } @Override public void doBeforeAction(IWebContext webContext) throws WebException { this.webContext = webContext; } public void getCurrentUser() throws BadRequestFormatException, UserNotFoundException { final UserService userService = new UserService(); //FIXME enhance the authenticating user name user = userService.getUserByUserName("williamcui"); } @Override public IRendererContext doAfterAction() throws WebException { return new ObjectRendererContext(webContext, user); } }