Sunday, 6 December 2015

Exception while calling a Servlet in AEM

Question:  I am trying to access a servlet with a doPost method from the JSP and getting the following exception -Caused by Resource at ‘/location/Stores’ is not modifiable.
My bundle is built successfully and the resource resolver shows the path as expected and resolves to the given path.Activate method of the servlet is successfully called.However while trying to give an Ajax call from the jsp it never reaches the doPost method.I tried it both with doPost and doGet.Please help.
Answer: Give your servlet path as /bin/location/Stores or /services/location/Stores which is configured in ‘Apache Sling Servlet Resolver’
If you want, you can add your own Servlet/Script resolver from /system/console/configMgr and your custom resourcePath will be resolved by the servlet resolver

No comments :

Post a comment