59
4. Developing Your Own Pages
Once you have installed and configured a webMathematica server so that the examples run correctly and have
studied the basics of writing material for webMathematica, as described
previously
, you are ready to start develop
ing your own material.
One way to start is to make your own area in the webMathematica web application. You could make a directory
here (for example NewScripts) and copy one of the samples (for example Plot.jsp) from the Examples
directory. You could then access this script with the URL http://localhost:8080/webMathematica/
NewScripts/Plot.jsp.
This might be a good time to revisit the webMathematica index page found at http://localhost:8080/web
Mathematica/index.html, which provides a number of links that demonstrate features of webMathematica. When
you actually want to write your own material you may look at the
Tips and Tricks
described in this chapter. The
chapter continues to describe other page development utilities that are part of webMathematica.
4.1 Tips and Tricks
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.
4.1.1 Variables
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 set
ting variable may be set by an input field. In Mathematica code it is called $$setting.
If[ MSPValueQ[ $$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.
.
<
New Page 1
Comcast Web Hosting