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" %>
<title>MSP Include Example</title>
<h1>MSP Include Example</h1>
This JSP uses the MSP Taglib to demonstrate including
the results of an entire MSP.
<msp:includeClassicMSP name="Examples/PlotSingle" arguments="fun=Sin[x]&x1=10" />
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.