All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.objectos.way.ui.RequestReflectionGuice Maven / Gradle / Ivy

/*
 * RequestReflectionGuice.java criado em 26/08/2011
 * 
 * Propriedade de Objectos Fábrica de Software LTDA.
 * Reprodução parcial ou total proibida.
 */
package br.com.objectos.way.ui;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.sitebricks.headless.Request;

/**
 * Just to make it easier to test ReplyGen.
 * 
 * @author [email protected] (Marcio Endo)
 */
@Singleton
class RequestReflectionGuice implements RequestReflection {

  private final Provider requestProvider;

  @Inject
  public RequestReflectionGuice(Provider requestProvider) {
    this.requestProvider = requestProvider;
  }

  @Override
  public boolean isMootoolsAjax() {
    // http://davidwalsh.name/mootools-history
    Request request = requestProvider.get();
    String header = request.header("X-Requested-With");

    return header != null && header.toLowerCase().equals("xmlhttprequest");
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy