Tip: Click lines to highlight, hold ctrl/cmd to multi-select

http://codedumper.com/egafi (21-Jul @ 06:33)

Syntax Highlighted Code

  1. public class GetCurrentUser extends ActionAdapter {
  2.  
  3.     private IWebContext webContext;
  4.    
  5.     private User user;
  6.    
  7.     public GetCurrentUser() {
  8.     }
  9.    
  10.     @Override
  11.     public void doBeforeAction(IWebContext webContext) throws WebException {
  12.         this.webContext = webContext;
  13.     }
  14.  
  15.     public void getCurrentUser() throws BadRequestFormatException, UserNotFoundException {
  16.         final UserService userService = new UserService();
  17.         //FIXME enhance the authenticating user name
  18.         user = userService.getUserByUserName("williamcui");
  19.     }
  20.    
  21.     @Override
  22.     public IRendererContext doAfterAction() throws WebException {
  23.         return new ObjectRendererContext(webContext, user);
  24.     }
  25.  
  26. }

Plain Code

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);
    }

}

Permalink: http://codedumper.com/egafi