Package play.mvc.Http

Examples of play.mvc.Http.Context.request()


        ODocument doc=FileService.getById(id);
        if (doc==null) return notFound(id + " file was not found");
        String filename=(String)doc.field("fileName");
       
        Context ctx=Http.Context.current.get();
        Boolean download = BooleanUtils.toBoolean(ctx.request().getQueryString(QUERY_STRING_FIELD_DOWNLOAD));
        String resize = ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE);
        boolean resizeIsEmpty=StringUtils.isEmpty(resize);
        Integer sizeId = Ints.tryParse(ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE_ID)+"");
       
        byte[] output;
View Full Code Here


        if (doc==null) return notFound(id + " file was not found");
        String filename=(String)doc.field("fileName");
       
        Context ctx=Http.Context.current.get();
        Boolean download = BooleanUtils.toBoolean(ctx.request().getQueryString(QUERY_STRING_FIELD_DOWNLOAD));
        String resize = ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE);
        boolean resizeIsEmpty=StringUtils.isEmpty(resize);
        Integer sizeId = Ints.tryParse(ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE_ID)+"");
       
        byte[] output;
        if (sizeId!=null){
View Full Code Here

       
        Context ctx=Http.Context.current.get();
        Boolean download = BooleanUtils.toBoolean(ctx.request().getQueryString(QUERY_STRING_FIELD_DOWNLOAD));
        String resize = ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE);
        boolean resizeIsEmpty=StringUtils.isEmpty(resize);
        Integer sizeId = Ints.tryParse(ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE_ID)+"");
       
        byte[] output;
        if (sizeId!=null){
          output = FileService.getResizedPicture(id, sizeId);
          String[] fileName=((String)doc.field("fileName")).split("\\.");
View Full Code Here

//        return new SimpleDateFormat(I18N.getDateFormat()).format(date);
//    }
//
    public static String format(Date date, String pattern) {
      Context ctx = Context.current.get();
      if (ctx != null && ctx.request() != null) {
        Lang lan = play.i18n.Lang.preferred(ctx.request().acceptLanguages());
        return format(date, pattern, lan.language());
      }
      else {
        return format(date, pattern, play.i18n.Lang.defaultLang().language());
View Full Code Here

//    }
//
    public static String format(Date date, String pattern) {
      Context ctx = Context.current.get();
      if (ctx != null && ctx.request() != null) {
        Lang lan = play.i18n.Lang.preferred(ctx.request().acceptLanguages());
        return format(date, pattern, lan.language());
      }
      else {
        return format(date, pattern, play.i18n.Lang.defaultLang().language());
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.