All Downloads are FREE. Search and download functionalities are using the official Maven repository.

controllers.FilterController Maven / Gradle / Ivy

There is a newer version: 9.1.0-Beta4
Show newest version
package controllers;

import filters.*;
import io.mangoo.annotations.FilterWith;
import io.mangoo.routing.Response;
import io.mangoo.routing.bindings.Request;

public class FilterController {

    @FilterWith(ContentFilter.class)
    public Response filter() {
        return Response.ok();
    }

    @FilterWith(HeaderFilter.class)
    public Response headerfilter() {
        return Response.ok().bodyEmpty();
    }
    
    @FilterWith({FilterOne.class, FilterTwo.class, FilterThree.class})
    public Response filters(Request request) {
        String one = (String) request.getAttribute("filterone");
        String two = (String) request.getAttribute("filtertwo");
        String three = (String) request.getAttribute("filterthree");
        
        return Response.ok().bodyText(one + two + three);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy