Hi Team,
In AEM as a Cloud (ver 2022.9.8722.20220912T101352Z-220800), we are using the Core Form Container to build a Simple form which contains Form Text, Form Options and a Form Button. On clicking the Submit button, I am getting the below Forbidden error and from my custom log configuration, I could see that my servlet is not getting called and can't able to see any errors related to this in error.log file as well. Since, it is a OOTB core component, not sure on what we are missing here. Could you please help us on how to get these form data to our backend? Thanks.
Dialog:
Form:
MyServlet:
@component(service = Servlet.class, property = { "sling.servlet.methods=" + HttpConstants.METHOD_POST,
"sling.servlet.paths=/bin/myproject/formpoc", "sling.servlet.selectors=formHandler",
"sling.servlet.extensions=html" })
public class GetFormDataPoc extends SlingAllMethodsServlet {
private static final Logger log = LoggerFactory.getLogger(GetFormDataPoc.class);
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
log.debug("@@@ Inside doPost of GetFormDataPoc");
}
}
On Submit the form:
Solved! Go to Solution.
Views
Replies
Total Likes
ok, the one I created was to store data in AEM
action="/content/usergenerated/<some-path>/cq-gen1655981669857/"
actionType="foundation/components/form/actions/store"
In you case you have to create the above Endpoint (servlet) and use relative path if it in AEM and register with sling resourcetype but not via path otherwise you may have issue when you deploy to cloud.
Here are a few things you can do to troubleshoot the issue:
Hi @Lokesh_Vajrala,
Please find the responses inline,
Please let me know if any more information is required, Thanks.
Hi,
It seems user don't have write access at /content/usergenerated path, where data is going to be stored.
Hi @arunpatidar, But I am doing this in my author environment with admin user.
Hi,
With admin user, it should work.
Can you check your form container, if all the configurations are correct?
Yes @arunpatidar. Below is the snippet of my Core Form Container configurations. But, on clicking the submit button, I am getting the above said error with no trace of logs in error log and in my custom log and also in browser network tab. My bundle is in active state with my GetFormDataPoc registered in it. Still not sure on what is going wrong here.
ok, the one I created was to store data in AEM
action="/content/usergenerated/<some-path>/cq-gen1655981669857/"
actionType="foundation/components/form/actions/store"
In you case you have to create the above Endpoint (servlet) and use relative path if it in AEM and register with sling resourcetype but not via path otherwise you may have issue when you deploy to cloud.
I have similar issue. I am using Post from Data, but it is not hitting my servlet. My servlet url is /bin/stewart/procurementServlet. Not sure what am I missing.
Views
Replies
Total Likes
Views
Likes
Replies