How to block request if Context-Type contains “addHeader”

别来无恙 提交于 2020-01-30 12:02:00

问题


I want to block a request if contains in header "addHeader". How can I do this?. I already search on Google and find doFilter method but I don't understand how I using this. There is no explanatory examples for me. In jsp file I have already write this code block;

String example  = request.getHeader("Content-Type") + " This is from req. header";
System.out.println(example);
if(example.contains("addHeader")){

    System.out.println("Contains AddHeader!!");
    Block Req.

}

Thanks for helping :)

来源:https://stackoverflow.com/questions/57552843/how-to-block-request-if-context-type-contains-addheader

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