Spring Security Problem Cannot Use Method POST

I have expirenced this problem when I was developing my web application using that framework.After I searched on google, I found the solution in stackoverflow.The solution is :

You need to add the following parameter to the end of your action form :

       
?${_csrf.parameterName}=${_csrf.token}

 




As an example here :

       
/admin/products/addproduct?${_csrf.parameterName}=${_csrf.token}

 


If you don't use enctype="multipart/form-data" for your form, you can use the following input :

       
<input type="hidden" name="${_csrf.parameterName}"
                                        value="${_csrf.token}" />


 


Thanks,
Steven Gunanto


Popular posts from this blog

How to restart the app with flutter Android and iOS

How to have ConstraintLayout inside ScrollView and ScrollView inside ConstraintLayout Android

Missing system image Android Studio solution