how to modify query params in a Jersey Filter

一个人想着一个人 提交于 2021-02-10 06:34:45

问题


According to Jersey documentation

Filters can be used when you want to modify any request or response parameters like headers

So I believe modifying query params is possible but I don't know how and I haven't been able to find anything on Google or stackoverflow...

This the functionality I would like to achieve:

public class EreturnLookupFilter implements ContainerRequestFilter {

    private static final Logger logger = Logger.getLogger(UserResource.class.getName());

    @Override
    public void filter(ContainerRequestContext requestContext) throws IOException {

        // requestContext.setParameter("paramName", <new Value>);
    }
}

I am not keen to use prematching as I am linking this filter to a specific resource method so requestContext.setRequestUri( builder.build() ); as suggested here is not an option for me.

thank you very much

来源:https://stackoverflow.com/questions/43557134/how-to-modify-query-params-in-a-jersey-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!