本文整理汇总了Java中org.takes.rs.RsVelocity类的典型用法代码示例。如果您正苦于以下问题:Java RsVelocity类的具体用法?Java RsVelocity怎么用?Java RsVelocity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RsVelocity类属于org.takes.rs包,在下文中一共展示了RsVelocity类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: route
点赞 3
import org.takes.rs.RsVelocity; //导入依赖的package包/类
@Override
public final Opt<Response> route(final RqFallback req) throws IOException {
return new Opt.Single<>(
new RsWithStatus(
new RsHtml(
new RsVelocity(
TkApp.class.getResource("error.html.vm"),
new RsVelocity.Pair(
"err",
new TextOf(req.throwable()).asString()
),
new RsVelocity.Pair(
"rev",
Manifests.read("Rehttp-Revision")
)
)
),
HttpURLConnection.HTTP_INTERNAL_ERROR
)
);
}
开发者ID:yegor256,
项目名称:rehttp,
代码行数:22,
代码来源:TkFatal.java
示例2: fatal
点赞 3
import org.takes.rs.RsVelocity; //导入依赖的package包/类
/**
* Make fatal error page.
* @param req Request
* @return Response
* @throws IOException If fails
*/
private static Response fatal(final RqFallback req) throws IOException {
return new RsWithStatus(
new RsHtml(
new RsVelocity(
TkApp.class.getResource("error.html.vm"),
new RsVelocity.Pair(
"err",
new TextOf(req.throwable()).asString()
),
new RsVelocity.Pair("rev", TkApp.REV)
)
),
HttpURLConnection.HTTP_INTERNAL_ERROR
);
}
开发者ID:yegor256,
项目名称:threecopies,
代码行数:22,
代码来源:TkApp.java
示例3: fatal
点赞 3
import org.takes.rs.RsVelocity; //导入依赖的package包/类
/**
* Make fatal error page.
* @param req Request
* @return Response
* @throws IOException If fails
*/
private static Response fatal(final RqFallback req) throws IOException {
return new RsWithStatus(
new RsWithType(
new RsVelocity(
TkAppFallback.class.getResource("error.html.vm"),
new RsVelocity.Pair(
"err",
ExceptionUtils.getStackTrace(req.throwable())
),
new RsVelocity.Pair("rev", TkAppFallback.REV)
),
"text/html"
),
HttpURLConnection.HTTP_INTERNAL_ERROR
);
}
开发者ID:yegor256,
项目名称:jare,
代码行数:23,
代码来源:TkAppFallback.java
示例4: fatal
点赞 3
import org.takes.rs.RsVelocity; //导入依赖的package包/类
/**
* Make fatal error page.
* @param req Request
* @return Response
* @throws IOException If fails
*/
private static Response fatal(final RqFallback req) throws IOException {
return new RsWithStatus(
new RsWithType(
new RsVelocity(
TkAppFallback.class.getResource("error.html.vm"),
new RsVelocity.Pair(
"err",
ExceptionUtils.getStackTrace(req.throwable())
),
new RsVelocity.Pair("rev", TkAppFallback.REV),
new RsVelocity.Pair("version", TkAppFallback.VERSION)
),
"text/html"
),
HttpURLConnection.HTTP_INTERNAL_ERROR
);
}
开发者ID:yegor256,
项目名称:wring,
代码行数:24,
代码来源:TkAppFallback.java
示例5: fatal
点赞 3
import org.takes.rs.RsVelocity; //导入依赖的package包/类
/**
* Make a fatal response.
* @param req Request
* @return Response
* @throws IOException If fails
*/
private static Response fatal(final RqFallback req) throws IOException {
final String err = ExceptionUtils.getStackTrace(
req.throwable()
);
Logger.error(TkAppFallback.class, "%[exception]s", req.throwable());
return new RsWithStatus(
new RsWithType(
new RsVelocity(
TkAppFallback.class.getResource("error.html.vm"),
new RsVelocity.Pair("error", err),
new RsVelocity.Pair("version", TkAppFallback.VERSION)
),
"text/html"
),
HttpURLConnection.HTTP_INTERNAL_ERROR
);
}
开发者ID:yegor256,
项目名称:thindeck,
代码行数:24,
代码来源:TkAppFallback.java