The doPost methodAdded by IBM on November 25, 2011 | Version 1 (Original)
|You use the Servlet's doPost method to process a submitted XFDL form. Processing may include saving the form to disk, archiving the form to a database, or sending the form to the next stage of a workflow.
You use the Servlet's doPost
method to process a submitted XFDL form. Processing may include saving the form to disk, archiving the form to a database, or sending the form to the next stage of a workflow.
In general, the doPost
method must respond to the submission of a completed form. This may be either an XFDL form or a previously translated HTML form. In either case, the following algorithm presents a simple way to respond to such a request:
- User submits the form to the servlet.
- If the form was previously translated into HTML, the IBMWorkplaceFormsServerServlet automatically translates the form back to XFDL, then passes it through to your doPost method. If the form is XFDL, it is automatically passed through to your doPost method.
- In your doPost method, you process the form as required.
- If a response is required, write the response to the output stream of the response object and set the content type appropriately. Otherwise, you can end your doPost method.
If a response is set, the IBMWorkplaceFormsServerServlet will send it to the user. If the response is an XFDL form, the IBMWorkplaceFormsServerServlet will automatically detect whether the user's computer has the Viewer installed, and will translate the form into HTML if necessary. If no response is set, operation will cease.
- For example, you might send an HTML page to confirm receipt of the submission, or you might load a second form from disk and return it to the user.
Parent topic: Normal Servlet Operations