Not able to authenticate post request for CSRF token with tomcat

后端 未结 1 1935
长发绾君心
长发绾君心 2021-01-19 04:50

I am working on a tomcat application. I am trying to add CSRF authentication token provided by catlina library(org.apache.catalina.filters.CsrfPrevention). I have added filt

相关标签:
1条回答
  • 2021-01-19 05:00

    Finally I got the answer. I am posting it here for others.

    For rendering the JSP I was using the RequestDispatcher object

    dispatcher.forward(request, response);
    

    So the filter was not getting applied to the given url. Finally I found the answer. Either I should have used dispatcher in parameter with the filter or response.sendRedirect method in Servlet handler.

    http://www.theserverside.com/news/thread.tss?thread_id=34168

    0 讨论(0)
提交回复
热议问题