Not Able to call Post Servlet in html form action tag
Hi,
I have created a custom search component and in that I had written a html file and for backend side I created a resource type servlet and services. The servlet is working fine, it is giving me the correct response while tested with postman. But when i used that servlet api in my custom component html page of form tag with action= servlet url and method=POST. Then I am getting an error 403 Forbidden with statement "Cannot serve request to /content/aem-site/us/en/component-basics/_jcr_content.geeks.xml in BundledScriptServlet (/libs/sling/servlet/errorhandler/default.jsp)".
Why this error is coming that I don't know. Then I figure out the Servlet Resolver where my servlet is working fine but not in html. Then I removed POST from the CSRF Filter then my servlet is working in the html. But why I have to remove the POST api method from the CSRF Filter, this is not proper solution. So can you please help me to find the solution for this.
I have attached videos for your reference and also for servlet backend code.
Component:
https://www.youtube.com/watch?v=m5z-htzR7ts&ab_channel=My%3FListeries
Servlet :
https://www.youtube.com/watch?v=OnqOffsIomM&ab_channel=My%3FListeries