|
1 | 1 | # Adaptive Form Submission Handling in fluent-forms-spring-boot-starter |
2 | 2 |
|
3 | 3 | The submission handling code looks for one or more beans in the Spring Context that provide the |
4 | | -`AfSubmissionHandler` interface. This interface has two methods `boolean canHandle(String formName)` |
| 4 | +`AfSubmissionHandler`[^1] interface. This interface has two methods `boolean canHandle(String formName)` |
5 | 5 | and `SubmitResponse processSubmission(Submission submission)`. Whenever a submission comes in, the |
6 | | - `canHandler` method is called on each `AfSubmissionHandler` bean – passing in the Adaptive Form’s name. |
7 | | -The first `AfSubmissionHandler` that returns `true` (to indicate it can handle this form’s submission) |
| 6 | + `canHandler` method is called on each `AfSubmissionHandler` bean � passing in the Adaptive Form�s name. |
| 7 | +The first `AfSubmissionHandler` that returns `true` (to indicate it can handle this form�s submission) |
8 | 8 | will have its `processSubmission()` method called. |
9 | 9 |
|
10 | | -The `processSubmission()` method receives a `Submission` object (which is populated with the submission’s |
11 | | -information such as the form data, form name, http headers and the submission redirect URL). The |
12 | | -`processSubmission()` method returns a `SubmitResponse` interface which contains information that will be |
| 10 | +The `processSubmission()` method receives a `Submission`[^2] object (which is populated with the submission�s information such as the form data, form name, http headers and the submission redirect URL). The |
| 11 | +`processSubmission()` method returns a `SubmitResponse`[^3] interface which contains information that will be |
13 | 12 | placed in the response. It can currently be a `Response` object, a `SeeOther` object or a `Redirect` |
14 | 13 | object (which all implement the `SubmitResponse` interface). A `Response` object is for returning text, |
15 | 14 | html, json, etc. to the browser. A `SeeOther` will redirect the browser to perform a GET on another URL. A `Redirect` will redirect the browser to perform a POST to another URL. |
16 | 15 |
|
17 | 16 | There are a bunch of static convenience methods in `AfSubmissionHandler` that means that you probably |
18 | | -won’t have to create an `AfSubmissionhandler` directly, but can use a convenience method like |
| 17 | +won�t have to create an `AfSubmissionhandler` directly, but can use a convenience method like |
19 | 18 | `AfSubmissionHandler. canHandleFormNameEquals(String formName, Function<Submission, SubmitResponse> handlerLogic)` |
20 | 19 | and others. |
21 | 20 |
|
22 | 21 | There are also static convenience functions in the `SubmitResponse.Response` object that make it easy to |
23 | 22 | create the most common responses (e.g. `Response json(String json)`). |
| 23 | + |
| 24 | +[^1]: com._4point.aem.fluentforms.spring.AemProxyAfSubmission.AfSubmissionHandler |
| 25 | +[^2]: com._4point.aem.fluentforms.spring.AemProxyAfSubmission.AfSubmissionHandler.Submission, |
| 26 | +[^3]: com._4point.aem.fluentforms.spring.AemProxyAfSubmission.AfSubmissionHandler.SubmitResponse |
0 commit comments