use of act.route.UrlPath in project actframework by actframework.
the class RenderCSV method setDownloadHeader.
private static void setDownloadHeader(ActContext context) {
if (context instanceof ActionContext) {
ActionContext ctx = (ActionContext) context;
UrlPath path = ctx.urlPath();
String fileName = S.concat(S.underscore(path.lastPart()), ".csv");
ctx.resp().contentDisposition(fileName, false);
}
}
Aggregations