For 5.6 Form components - we have this documentation:
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developing-forms.html
To develop your onw form action - see:
https://docs.adobe.com/docs/en/cq/5-6-1/developing/developing-forms.html#Developing your own Form Actions
More info on this
The docs state:
In the folder create either:
- A post script.
The name of the script is post.POST.<extension>; e.g. post.POST.jsp
The post script is invoked when a form is submitted to process the form, it contains the code that handles the data arriving from the form POST. - Add a forward script which is invoked when the form is submitted.
The name of the script is forward.<extension>; e.g. forward.jsp
This script can define a path. The current request is then forwarded to the specified path.
Make sure you have either forward.jsp and post.POST.jsp. I only have post.POST.jsp.
I removed forward.jsp and post.POST.jsp is called
Here is my post.POST.jsp:
<%@include file="/libs/foundation/global.jsp"%>
<%@page import="com.day.cq.wcm.foundation.forms.FormsHelper,
org.apache.sling.api.resource.ResourceUtil,
org.apache.sling.api.resource.ValueMap" %>
<%@taglib prefix="sling"
uri="http://sling.apache.org/taglibs/sling/1.0" %>
<%@taglib prefix="cq"
uri="http://www.day.com/taglibs/cq/1.0"
%>
<cq:defineObjects/>
<sling:defineObjects/>
<%
String First = request.getParameter("First");
String Last = request.getParameter("Last");
String City = "Ottawa";
String Address = "Carp";
com.adobe.cq.HandleForm hf = sling.getService(com.adobe.cq.HandleForm.class);
hf.injestFormData(First,Last,City, Address);
%>
In this example –my form has 2 fields:
The post.POST.jsp is sending data to an OSGi. The same one used in adaptive form article:
http://scottsdigitalcommunity.blogspot.ca/2014/05/posting-aem-6-form-data-to-sling.html
The OSGi logs the values,
23.02.2016 15:04:41.793 *INFO* [0:0:0:0:0:0:0:1 [1456257881509] POST /content/geometrixx/en/products/triangle.html HTTP/1.1] com.adobe.cq.HandleFormImpl **** Hi Lee -- look at the data posted from an AEM adaptive form - First: Tom Last: Macdonald City: Ottawa Address Carp