title: Action composition in Play framework with Java
body: <p>I'm developing a security implementation for Play with composition of actions.</p>
  
  <p>For security reasons sent an access token in the JSON request payload, not in the header of the request.
  What I do is, in an action (SecureAction) extract the token and continue with the next action ... As can modify the request in Http.Context?
  Some code ..</p>
  
  <pre><code>@With(SecureAction.class)
  @Retention(RetentionPolicy.RUNTIME)
  @Target({ElementType.METHOD})
  @Inherited
  @Documented
  public @interface Secured {
      //TODO ver parametros de acceso ..... al metodo
  
  }
  
  public class SecureAction extends Action.Simple {
  
      @Override
      public Result call(Http.Context ctx) throws Throwable {
          //TODO extract token of request "ctx.request().body()"
          //TODO change request with new body witout token and delegate to the next action
          return delegate.call(ctx);
      }
   }
  
   @actions.security.Secured
   public static Result addAccount() {
  
       Form&lt;Account&gt; f = form(Account.class).bindFromRequest();
          if (f.hasErrors()) {
              return badRequest();
          }
  
          .....
   }
  </code></pre>
  
  <p>Greetings!!!!</p>