Package play.mvc.Http

Examples of play.mvc.Http.Request


    @SuppressWarnings("unchecked")
    public File[] bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) {
        if (value == null || value.trim().length() == 0) {
            return null;
        }
        Request req = Request.current();
        if (req != null && req.args != null) {
            List<File> fileArray = new ArrayList<File>();
            List<Upload> uploads = (List<Upload>) req.args.get("__UPLOADS");
            if (uploads != null) {
                for (Upload upload : uploads) {
View Full Code Here


    @SuppressWarnings("unchecked")
    public File bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) {
        if (value == null || value.trim().length() == 0) {
            return null;
        }
        Request req = Request.current();
        if (req != null && req.args != null) {
            List<Upload> uploads = (List<Upload>) req.args.get("__UPLOADS");
            if(uploads != null){
                for (Upload upload : uploads) {
                    if (upload.getFieldName().equals(value)) {
View Full Code Here

    @SuppressWarnings("unchecked")
    public Upload[] bind(String name, Annotation[] annotations, String value, Class actualClass, Type genericType) {
        if (value == null || value.trim().length() == 0) {
            return null;
        }
        Request req = Request.current();
        if (req != null && req.args != null) {
            List<Upload> uploadArray = new ArrayList<Upload>();
            List<Upload> uploads = (List<Upload>) req.args.get("__UPLOADS");
            if(uploads != null){
                for (Upload upload : uploads) {
View Full Code Here

    }
   
    public void initMvcObject(){
        if (Request.current() == null) {
            Request request = Request
                    .createRequest(null, "GET", "/", "", null, null, null,
                            null, false, 80, "localhost", false, null, null);
            request.body = new ByteArrayInputStream(new byte[0]);
            Request.current.set(request);
        }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void beforeInvocation()
  {
    EbeanServer server = defaultServer;

    Request currentRequest = Http.Request.current();
    if (currentRequest != null) {
      // Hook to introduce more data sources
      Map<String, DataSource> ds = (Map<String, DataSource>) currentRequest.args.get("dataSources");
      if (ds != null && ds.size() > 0) {
        // Currently we support single data source
View Full Code Here

        new RuleProcessor().execute(jobData);
    }

    private static Response executeTask(TaskStateInfo taskInfo) {
        List<HeaderWrapper> wrappers = taskInfo.getHeaders();       
        Request request = newRequest();
       
        // generate request headers
        request.headers = Maps.newHashMap();
        for (HeaderWrapper wrapper : wrappers) {
            Header header = new Header();
View Full Code Here

    Session session = Session.current();
    if(session != null) {
      setupMDC(session);
    }
   
    Request current = Request.current();
    if(current != null) {
      if(isProduction || (!current.path.startsWith("/public")))
        log.info("---begin request="+current.method+":"+current.path);
    }
  }
View Full Code Here

  @Override
  public void invocationFinally() {
    Long start = startTime.get();
    //start will be null IF StartupBean was just invoked!!!!
    if(start != null) {
      Request current = Request.current();
      long total = System.currentTimeMillis() - start;
      startTime.set(null);
      if(isProduction || (!current.path.startsWith("/public")))
        log.info("---ended request="+current.method+":"+current.path+" total time="+total+" ms");
    }
View Full Code Here

    return InjectAdapter.getInstance().getInstance(type);
  }

  protected void setHttpContext(Map<String, String[]> requestBody) {
    RequestHeader reqHeader = mock(RequestHeader.class);
    Request req = mock(Request.class);
    if (requestBody != null) {
      RequestBody reqBody = mock(RequestBody.class);
      when(req.body()).thenReturn(reqBody);
      when(reqBody.asFormUrlEncoded()).thenReturn(requestBody);
    }
    Map<String, String> session = new HashMap<String, String>();
    Map<String, String> flash = new HashMap<String, String>();
    Map<String, Object> args = new HashMap<String, Object>();
View Full Code Here

    Context.current.set(new Context(1L, reqHeader, req, session, flash, args));
  }
 
  protected void setHttpContext(JsonNode requestBody) {
    RequestHeader reqHeader = mock(RequestHeader.class);
    Request req = mock(Request.class);
    if (requestBody != null) {
      RequestBody reqBody = mock(RequestBody.class);
      when(req.body()).thenReturn(reqBody);
      when(reqBody.asJson()).thenReturn(requestBody);
    }
    Map<String, String> session = new HashMap<String, String>();
    Map<String, String> flash = new HashMap<String, String>();
    Map<String, Object> args = new HashMap<String, Object>();
View Full Code Here

TOP

Related Classes of play.mvc.Http.Request

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.