Search in sources :

Example 1 with UrlPath

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);
    }
}
Also used : UrlPath(act.route.UrlPath) ActionContext(act.app.ActionContext)

Aggregations

ActionContext (act.app.ActionContext)1 UrlPath (act.route.UrlPath)1