Hi @ AEMWizard,
There is no magic in AEM Core Components Forms container implementation 😉
This is how it works OOTB:
- Any POST request is processed by CoreFormHandlingServlet.
- In the background CoreFormHandlingServlet is using FormsHandlingServletHelper.
- FormsHandlingServletHelper relies on :formstart parameter that is hidden parameter passed automatically as part of POST request from Core Form Container.
- :formstart parameter stores information about path to Core Form Container on specific page (path where it has been used and configured)
- Base on information from :formstart parameter actionType property is read from repository.
- actionType property holds value (path) of action that as been defined by author on Core Form Container component level.
- Path to actionType definition is used to proceed form data.
Examples of definition of OOTB actions can be found under:
- /apps/core/wcm/components/form/actions/rpc
- /libs/commerce/components/actions
In general proper way to use/extend OOTB Core Form is to create custom action, I have described how to do this under this topic:
Having above knowledge, lets try to answer your questions. In general it looks that your servlet is working, because your are not using OOTB one, and you have not extended Core Form in the way how it was designed. It seem that your servlet is executed directly instead of CoreFormHandlingServlet.
If you wanted to use custom servlet for from handling, then probably using Core Form was not the best choice. Because you are not using CoreFormHandlingServlet, to handle your form request you will not benefit from features Core Form provides, e.g. validation. The other drawback is a risk that other OOTB actions will not work correctly. Using a custom servlet is not a bad approach in general, but in that case it will be better to write custom form component as well. You do not need custom servlet to plugin custom action into Core Form.