Mathematica 9 is now available
3.13 Interacting with MSPs: IncludeMSP.jsp

Documentation3. Basic Examples

 

3.13 Interacting with MSPs: IncludeMSP.jsp

If you installed webMathematica as described above, you should be able to connect to this JSP via http://localhost:8080/webMathematica/Examples/IncludeMSP.jsp. (You may have some other URL for accessing your server.)

This example demonstrates how a JSP can call an MSP script. MSP scripts are the original form of webMathematica interaction that are now superseded by JSPs; they are described in Classic webMathematica Technology. The source for this page is in webMathematica/Examples/IncludeMSP.jsp, and a section is shown below.

<%@ page language="java" %>
<%@ taglib uri="/webMathematica-taglib" prefix="msp" %>

<html>
<head>
<title>MSP Include Example</title>
</head>
<body>

<h1>MSP Include Example</h1>

<p>
This JSP uses the MSP Taglib to demonstrate including
the results of an entire MSP.
</p>

<msp:includeClassicMSP name="Examples/PlotSingle" arguments="fun=Sin[x]&x1=10" />

</body>
</html>

In this example the <msp:includeClassicMSP> tag is used to include the result of the MSP script Examples/PlotSingle.msp. There are two attributes: name, which gives the MSP to be called, and arguments, which gives extra arguments for the MSP. This functionality is useful if you have existing MSPs and you wish to use them in a JSP. There is a closely related tag, msp:forwardClassicMSP, which forwards to an MSP.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. CURRENT WEBMATHEMATICA DOCUMENTATION IS NOW AVAILABLE.