This section provides a summary of a few issues that will help you to get started writing your own pages. These are all described in more detail in later sections of the User Guide, but are collected together here in a brief description. Getting a good grasp of these points will help you to make progress in developing your site.
There are two types of variable that are important to understand when you are getting started with webMathematica: input variables and page variables.
Input variables come with the HTTP request, for example from an input field in an HTML form. You can identify input variables in Mathematica code because they are labelled with a '$$' prefix. In the example below the setting variable may be set by an input field. In Mathematica code it is called $$setting.
You should be aware that input variables are a potential security risk to your server and should always use the special functions, MSPBlock and MSPToExpression, for converting into Mathematica input. In particular, you should never use ToExpression on an input variable. An example of using MSPBlock is shown below.
Page variables are Mathematica variables that you use to hold intermediate values. They are called page variables since they are cleared when the page is finished. In the example below, the page variable tmp is used to hold the expression that was entered into the text input field (which is held in an input variable called $$expr). Note the use of the secure function, MSPToExpression, to convert the Mathematica expression from the input.
Note that the Mathematica code will evaluate in the typical way for Mathematica and the result of the computation will appear in the web page. You can use MSPFormat to change the way that the result is formatted, more information on formatting in webMathematica is found in Advanced Topics: Evaluation Formatting. An example of MSPFormat is shown below; this formats the integral into TraditionalForm using a GIF image to display the result.