The AppComposer/examples/Math directory contains the JSP and HTML files that your capsule uses. Open the directory to see the files this project uses.
The file mathmain.html is a static HTML page that contains a form with various fields that a user can fill in. Open it in a browser.
The page offers to perform three different kinds of calculations for a series of numbers that the user specifies. The first calculation finds the numbers' squares. The second calculates their reciprocals (one divided by the number). The third calculation finds the numbers' sines.
Once you decide which calculations you want to perform, you have to designate a series of numbers to use in the calculations. You pick a value to begin the series with, and one to end it. The input fields on the form allow entries of up eight digits, so within that constraint you can enter any number.
If you entered values and submitted the form now, your browser would display an error message, because nothing has been set up yet to process the information from the form and send the results back to the browser. You need to build a servlet for this. It will process the input, check for any errors, and generate a table that displays results for the numbers and calculations that the user chooses.
The Projects pane is in the upper left corner of your AppComposer window.
If you do not have a project pane open, select Projects from the View menu or click the Project tab on the tool bar. The project editor allows you to track all of the resources for a multi-file project.
Note: AppComposer's project editor governs the file tree, or relative paths between the capsules and resources in your project. Any reference from the capsule to the other files in the project must use the path as the project editor defines it, which may differ from how they are saved on your hard drive.
Use a text or HTML-source editor to take a look at the JSP and HTML files in the project. You will use these resource files to create a servlet that takes the input from the mathmain.html file and processes it to create results to display in the mathtable.jsp file.
The next section shows you how AppComposer handles communication between servlets and external files and gets you started building the logic for this project.