11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

webMathematica User Guide 61This example gets values computed in Mathematica into a JSP where they are used for processingby the page. The source for this page is in webMathematica/Examples/GetBasic.jsp, anda selection is shown below.num = RandomInteger[{1, 10}];list = RandomReal[{0, 1}, num];mean = Mean[list];${d}In this example, Mathematica generates a list of random numbers and computes the mean. TheJSP obtains these values using the msp:get tag. The setting of the value attribute is used as aMathematica expression to be evaluated and transmitted to Java. This is stored as a pagecontext variable using the name attribute setting of the tag. The rules for transmission fromMathematica are that the normal J/Link type conversions will be applied, but if none of theseapplies, then the object will be converted into an object of type com.wolfram.jlink.Expr, a classthat is provided by J/Link to represent general Mathematica expressions.The example also makes use of extended JSP tags. It also requires programming in both Javaand Mathematica. It shows how easy it would be to incorporate webMathematica into an existingJSP framework.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!