当前位置: 首页>>代码示例>>Java>>正文


Java AnyContent类代码示例

本文整理汇总了Java中play.api.mvc.AnyContent的典型用法代码示例。如果您正苦于以下问题:Java AnyContent类的具体用法?Java AnyContent怎么用?Java AnyContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AnyContent类属于play.api.mvc包,在下文中一共展示了AnyContent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWrappedRequest

import play.api.mvc.AnyContent; //导入依赖的package包/类
@SuppressWarnings(value = "unchecked")
public play.api.mvc.Request<play.mvc.Http.RequestBody> getWrappedRequest() {
    return ((play.api.test.FakeRequest<play.api.mvc.AnyContent>)fake).map(new scala.runtime.AbstractFunction1<play.api.mvc.AnyContent, play.mvc.Http.RequestBody>() {
        public play.mvc.Http.RequestBody apply(play.api.mvc.AnyContent anyContent) {
            return new play.core.j.JavaParsers.DefaultRequestBody(
                    anyContent.asFormUrlEncoded(),
                    anyContent.asRaw(),
                    anyContent.asText(),
                    anyContent.asJson(),
                    anyContent.asXml(),
                    anyContent.asMultipartFormData(),
                    false
                    );
        }
    });
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:17,代码来源:FakeRequest.java

示例2: create

import play.api.mvc.AnyContent; //导入依赖的package包/类
public static void create(long duration, LogCategory logCategory, Request<AnyContent> request, String text) {
  if (Global.isPerformanceLogging() == true) {
    PerformanceLog result = new PerformanceLog();
    result.duration = duration;
    abstractCreate(result, logCategory, LogLevel.INFO, request, new LinkedList<AbstractModel>());
    if (text != null) {
      result.httpUrl += " - " + text;
    }
    Neo4JServiceProvider.get().performanceLogRepository.save(result);
  } else {
    String requestString = logCategory.toString();
    if (request != null) {
      requestString += " " + request.uri();
    }
    if (text != null) {
      requestString += " - " + text;
    }
    Logger.info(requestString + " took " + duration + " ms");
  }
}
 
开发者ID:unterstein,项目名称:play-neo4j-template,代码行数:21,代码来源:PerformanceLog.java

示例3: at

import play.api.mvc.AnyContent; //导入依赖的package包/类
@SunriseRoute(AssetsReverseRouter.ASSET)
public Action<AnyContent> at(String file) {
    return super.at(file);
}
 
开发者ID:commercetools,项目名称:commercetools-sunrise-java,代码行数:5,代码来源:SunriseAssetsController.java

示例4: convert

import play.api.mvc.AnyContent; //导入依赖的package包/类
public static BridgeRequest convert(final Request<AnyContent> request){
	return new ScalaBridgeRequest(request);
}
 
开发者ID:hunatika615,项目名称:crudefox-oauth2-play2,代码行数:4,代码来源:Bridge.java

示例5: at

import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at (final String path, final String file) {
	return controllers.Assets.at (path, getLang ().language () + "/" + file, false);
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:4,代码来源:Docs.java

示例6: at

import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at(String path, String file)
   {
return controllers.Assets.at(path, file);
   }
 
开发者ID:beligum,项目名称:com.beligum.core.play,代码行数:5,代码来源:Assets.java

示例7: at

import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at(String path, String file) {
	return controllers.Assets.at(path, file, false);
}
 
开发者ID:hakandilek,项目名称:play2-crud,代码行数:4,代码来源:Assets.java

示例8: withAnyContent

import play.api.mvc.AnyContent; //导入依赖的package包/类
/**
 * Set a AnyContent to this request.
 * @param content the AnyContent
 * @param contentType Content-Type header value
 * @param method The method to be set
 * @return the Fake Request
 */
public FakeRequest withAnyContent(AnyContent content, String contentType, String method) {
    Map<String, Seq<String>> map = new HashMap<String, Seq<String>>(Scala.asJava(fake.headers().toMap()));
    map.put("Content-Type", Scala.toSeq(new String[] {contentType}));
    fake = new play.api.test.FakeRequest(method, fake.uri(), new play.api.test.FakeHeaders(Scala.asScala(map).toSeq()), content, fake.remoteAddress(), fake.version(), fake.id(), fake.tags());
    return this;
}
 
开发者ID:vangav,项目名称:vos_backend,代码行数:14,代码来源:FakeRequest.java

示例9: body

import play.api.mvc.AnyContent; //导入依赖的package包/类
public AnyContent body(); 
开发者ID:hunatika615,项目名称:crudefox-oauth2-play2,代码行数:2,代码来源:BridgeRequest.java


注:本文中的play.api.mvc.AnyContent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。