Basic Examples
This covers a number of initial examples of legacy MSP scripting. Many of these can be copied and used as the basis for your own work.
These examples are a form of JavaServer Pages (JSPs) that use a special library of tags that work with the Wolfram Engine. JSPs support the embedding of Java into HTML and are frequently used with Java Servlets to develop large, dynamic websites. The library of tags is called the MSP Taglib and will work on any compliant servlet engine. One advantage of the use of a tag library is that it can completely hide any use of the Java programming language; this is the case with the MSP Taglib.
Here, you can learn the basics of MSP scripts. This requires some knowledge of HTML, including form and input elements. A reference to HTML is included at the end of this document. If you have no understanding of form elements, it will be hard to write interactive examples for MSP.
The description given here will work through a collection of sample JSPs, each of which will demonstrate some detail or feature. The sources for all these examples are included in the Wolfram Web Engine web application in the directory Examples (the full path in Tomcat is webapps/WolframWebEngine/Examples). If you followed the installation steps when you installed your server, you should be able to see these examples running live in your server. Please note that these examples are designed to be simple examples of how to program with MSP technology and have not been created for pleasing visual appearance.
When you have finished, you may wish to look at Developing Your Own Pages. This gives some ideas for starting to develop your own site.
Hello.jsp
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Hello.jsp. (You may have some other URL for accessing your server.)
This example evaluates the Date[] function of Wolfram Language. The result changes each time the page is accessed, demonstrating that this really is a dynamic process. The source for this page is in WolframWebEngine/Examples/Hello.jsp:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %> standard JSP headers
<html> standard HTML tags
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<h4>Date[]</h4>
<msp:evaluate>
Date::usage evaluated by Wolfram kernel
</msp:evaluate>
<p>Its current value is:</p>
<msp:evaluate>
Date[] evaluated by Wolfram kernel
</msp:evaluate>
This example shows a basic use of the Wolfram Web Engine.
</body>
</html>
This page uses standard HTML tags as well as special MSP tags; these have the form <msp:tag>. The MSP tags are executed from the top of the page to the bottom. The contents of the <msp:evaluate> tags are sent to the Wolfram Engine for computation with the result inserted into the final page.
Working with Variables: Variables.jsp
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this MSP via http://localhost:8080/webengine/Examples/Variables.jsp. (You may have some other URL for accessing your server.) It demonstrates how variables are connected to input values. The source for this page is in WolframWebEngine/Examples/Variables.jsp:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Assigning Variables</title>
</head>
<body>
<h1>Assigning Variables</h1>
<form action="Variables.jsp" method="post"> HTML form
Enter something:
<input type="text" name="input" size="10" value=" field for user input
<msp:evaluate>MSPValue[$$input, "foo"]</msp:evaluate>"
/> <br/>
<input type="image" button for activating form
src="../Resources/Images/Buttons/evaluate.gif"
alt="Evaluate"/>
</form>
<msp:evaluate>$$input</msp:evaluate> evaluated by Wolfram kernel
This example shows how to use form variables with the Wolfram Web Engine.
</body>
</html>
This page is more elaborate because it contains form and input elements. These are important ways for allowing interaction from the client.
A form element is a block of HTML that may contain input elements. A form may be activated with an input of type submit; this sends the name and value associated with each input tag to the server. Here, the opening tag of the form element contains two attributes. The action attribute refers to a URL that is accessed when the form is activated. In this case, it is a relative URL that refers to the original Variables.jsp script. The method attribute tells the browser what HTTP method to use, in this case a post method. (It is very common to use post methods.)
This example has two input tags: the first allows the user of the page to enter text, and the second specifies a button that, when pressed, will submit the form. When the form is submitted, it will send information from input elements to the URL specified by the action attribute (in this case, the same JSP). Text entered into the input tag, which uses the name input, will be assigned to the input variable $$input.
The first time the page is accessed, there is no value for $$input. When a value is entered in the text field and the Evaluate button pressed, $$input gets a value that is displayed. Note that the value is a Wolfram Language string—if you try and enter a computation such as "5+7", no computation is actually done. If you want the input to be interpreted and evaluated by the Wolfram Engine, you need to use one of the MSP functions.
Note that the $$ prefix is used to label input variables; these are variables that are sent with the HTTP request. The use of variables is discussed further in Tips and Tricks: Variables.
MSP Functions: Expand.jsp
If you installed theWolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Expand.jsp. (You may have some other URL for accessing your server.)
When the submit button is pressed, the polynomial is raised to the power and expanded, and an HTML page that contains the result is returned. The source for this page is in WolframWebEngine/Examples/Expand.jspp. A section that shows the form tag is shown here:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Expanding Polynomials</title>
</head>
<body>
<h1>Expanding Polynomials</h1>
<form action="Expand.jsp" method="post">
Enter a polynomial (e.g. x+y): <br/>
<input type="text" name="expr" size="10" value="
<msp:evaluate>MSPValue[ $$expr, "x+y"]</msp:evaluate>"
/>
Enter a positive integer (e.g. 4): <br/>
<input type="text" name="num" size="3" value="
<msp:evaluate>MSPValue[ $$num, "4"]</msp:evaluate>"
/>
<input type="image"
src="../Resources/Images/Buttons/evaluate.gif" alt="Evaluate">
</form>
<msp:evaluate>
MSPBlock[{$$expr,$$num}, secure computation with input variables
Expand[$$expr^$$num]]
</msp:evaluate>
This example demonstrates expanding polynomials.
</body>
</html>
This page contains form and input tags as described in the previous example. Additionally, the msp:evaluate tag refers to the MSP function MSPBlock.
When the form is submitted, the server connects to a Wolfram Kernel in which two symbols, $$expr and $$num, are assigned to the text from the two input elements. If no text is entered, the symbols will not have any definition.
The Wolfram kernel now evaluates the contents of the msp:evaluate tag. The MSPBlock command is a programming construct, which here inspects two input variables, $$expr and $$num. If either of these has no value, MSPBlock returns a null string, which is why the first time you access the page, you do not see a result. The values of both variables are then interpreted by the Wolfram Engine. If successful, the results of interpretation are substituted into the second argument or body of MSPBlock. In this example, all instances of $$expr are substituted with the parsed value of $$expr, and the same is done for $$num. The result is then evaluated, formatted and placed in the HTML page, which is returned to the client.
Interpretation of the variables by the Wolfram Engine can fail in two ways: the input might not be valid Wolfram Language input (for example, f[}]), or it might be dangerous input (such as ReadList["/etc/passwd"]). In both cases, the inputs are rejected and an error message generated. This demonstrates some of the security features of the system, which the Security section documents in detail. The use of variables is discussed further in Tips and Tricks: Variables.
The formatting of the result of an msp:evaluate tag is discussed in more details in Advanced Topics: Evaluation Formatting.
Graphics: Plot.jsp
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Plot.jsp. (You may have some other URL for accessing your server.)
This example generates a plot. The source for this page is in WolframWebEngine/Examples/Plot.jsp. A section that shows the form tag is shown here:
<form action="Plot.jsp" method="post">
Enter a function:
<input type="text" name="fun" size="24" value="
${msp:evaluate('MSPValue[$$fun, "Sin[x]^2"]')}"/> remember input settings from one call to the next
Enter a number:
<input type="text" name="x1" size="24" value="
${msp:evaluate('MSPValue[$$x1, "10"]')}"/>
<input type="image"
src="../Resources/Images/Buttons/plot.gif" alt="Plot">
</form>
The example shows the use of the MSP functions MSPBlock and MSPShow. MSPBlock is a programming construct introduced in the previous section. MSPShow takes the Wolfram Language graphics object from the Plot command and generates a GIF image, which is stored on the server, returning an <img> tag. A further discussion on formatting mathematics and graphics is given in the section on Displaying Mathematics and Graphics. Note how the page uses MSPValue to keep the user input each time the page is used.
Typeset Images: Integrate.jsp
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Integrate.jsp. (You may have some other URL for accessing your server.)
This example allows the user to enter a function to be integrated. The result is then formatted by the typesetting system and saved as an image. The source for this page is in WolframWebEngine/Examples/Integrate.jsp. A section that shows the form tag is shown here:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Integrate A Function</title>
</head>
<body>
<h1>Integrate A Function</h1>
<form action="Integrate.jsp" method="post">
<msp:evaluate>
integrand = Null; kernel request variable to hold the integrand
If[ MSPValueQ[ $$expr],
integrand = MSPToExpression[$$expr]]; interpret input with secure conversion
</msp:evaluate>
Input:<br/>
<input type="text" name="expr" size="24"
value="<msp:evaluate>MSPValue[ $$expr, "Sin[x]^2"]</msp:evaluate>"/>
<input type="image"
src="../Resources/Images/Buttons/evaluate.gif" alt="Evaluate">
</form>
<msp:evaluate>
If[integrand =!= Null,
MSPFormat[Integrate[integrand,x], StandardForm]] carry out the integration
</msp:evaluate>
This example shows how to generate typeset output with the Wolfram Web Engine.
</body>
</html>
In this example, an msp:evaluate tag integrates an expression and uses MSPFormat to format the result with StandardForm. This generates an image and returns a reference to the image. For this to work, it is necessary to use the Wolfram Engine front end.
The example also demonstrates the use of page variables with MSPToExpression. This is an alternative to using MSPBlock that is suitable in certain constructions, for example when the input will be used in a number of computations. The page variable integrand is initialized to Null and later, if its value has been modified, the integration is carried out. It is assigned to the interpreted value of $$expr only if this input variable actually has a value. Note that if an error, such as a security error, is encountered in interpreting $$expr, an exception will be thrown and integrand will remain assigned to Null.
Note that MSPToExpression applies a security check to the input variable. You should be aware that input variables are a major source of danger and you should always use the secure conversion functions MSPBlock and MSPToExpression. In particular, you should never use ToExpression on an input variable. The Security section documents the security system in more detail.
It is also possible to return the result using MathML; this is described in greater detail in the section on MathML. A further discussion on formatting mathematics and graphics is given in the section on Displaying Mathematics and Graphics.
An interesting point about the first msp:evaluate tag is that it contains two Wolfram Language commands. To use two commands in the same tag, they can be separated with a semicolon (;). In addition, the last command is also followed by a semicolon. This makes sure that no output from the tag is inserted into the output page. More information on adding code into MSP pages is given in Tips and Tricks: Coding in Pages.
Getting Messages: Messages.jsp
This example demonstrates how messages and print output generated by the Wolfram Engine can be returned in the webpage. If you installed the Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Messages.jsp. (You may have some other URL for accessing your server.) The source for this page is in WolframWebEngine/Examples/Messages.jsp:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Message and Print</title>
</head>
<body>
<h1>Message and Print</h1>
<h4>
Input is 1/0
</h4>
<msp:evaluate>
1/0
</msp:evaluate>
<h4>
Input is Sin[x,1]
</h4>
<msp:evaluate>
Sin[x,1]
</msp:evaluate>
<h4>Input is Print["The result is ", x^2];5.6</h4>
<msp:evaluate>
Print["The result is ", x^2];5.6
</msp:evaluate>
The messages were:
<msp:evaluate>
ColumnForm[MSPGetMessages[]] messages displayed here
</msp:evaluate>
<p>The print output was:</p>
<msp:evaluate>
ColumnForm[MSPGetPrintOutput[]] print output displayed here
</msp:evaluate>
These are some evaluations that will cause messages to be
generated by Wolfram Language. There is also a Wolfram Language print
statement.
</body>
</html>
The contents are very simple; there are two evaluations that cause messages to be generated. These are followed by use of MSPGetMessages and MSPGetPrintOutput, both of which are formatted by ColumnForm. The messages that were generated are displayed in the resulting page.
Returning General Content: Content.jsp
If you installed Wolfram Web Engine as described above, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/Content.jsp. (You may have some other URL for accessing your server.)
All of the examples up to this point return HTML to the browser, but the web can work with general content involving many different formats. MSPReturn is provided to allow an MSP to return arbitrary content. Here is an example that demonstrates how different formats can be returned. The source is in WolframWebEngine/Examples/Content.jsp and WolframWebEngine/WEB-INF/Applications/ExampleUtilities/Content.m.
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>General Content</title>
</head>
<body>
<h1>General Content</h1>
<table class="formLayout">
<tr>
<td colspan="4">
Please select a format:
</td>
</tr>
<tr>
<td>
<form action="Content.jsp" method="post" style="display: inline;">
<input type="image" src="../Resources/Images/Buttons/notebook.gif" alt="Notebook"/>
<input type="hidden" name="button" value="Notebook"/>
</form>
</td>
<td>
<form action="Content.jsp" method="post" style="display: inline;">
<input type="image" src="../Resources/Images/Buttons/pdf.gif" alt="PDF"/>
<input type="hidden" name="button" value="PDF"/>
</form>
</td>
<td>
<form action="Content.jsp" method="post" style="display: inline;">
<input type="image" src="../Resources/Images/Buttons/postscript.gif" alt="PostScript"/>
<input type="hidden" name="button" value="PostScript"/>
</form>
</td>
<td>
<form action="Content.jsp" method="post" style="display: inline;">
<input type="image" src="../Resources/Images/Buttons/gif.gif" alt="GIF"/>
<input type="hidden" name="button" value="GIF"/>
</form>
</td>
</tr>
</table>
<msp:evaluate>
Needs["ExampleUtilities`Content`"]
</msp:evaluate>
<msp:evaluate>
If[MSPValueQ[$$button],
MSPReturn @@ GeneralContent[$$button]
]
</msp:evaluate>
This example takes a format type and converts a notebook into
this format type. It returns the converted notebook.
</body>
</html>
Here is the Wolfram Language source:
MakeNotebook[fmt_] :=
Developer`UseFrontEnd[
Module[{nb, nbobj},
nb = NotebookCreate[];
NotebookWrite[nb, Cell["A Dynamically Created Notebook", "Title"]];
NotebookWrite[nb, Cell["Converted to " <> fmt, "Subtitle"]];
NotebookWrite[nb, Cell["The date is " <> ToString[Date[]], "Text"]];
SetOptions[nb, WindowSize -> {400,500}];
nbobj = NotebookGet[nb];
NotebookClose[nb];
nbobj
]
]
GeneralContent[fmt_] :=
Module[{nbobj},
nbobj = MakeNotebook[fmt];
Developer`UseFrontEnd[
AbortProtect[
Switch[fmt,
"Notebook",
{ToString[nbobj, InputForm], "application/mathematica", "Content.nb"}
,
"PostScript",
{ExportString[nbobj, "EPS"], "application/eps", "Content.eps"}
,
"PDF",
{ExportString[nbobj, "PDF"], "application/pdf", "Content.pdf"}
,
"GIF",
{ExportString[nbobj, "GIF"], "image/gif", "Content.gif"}
,
_,
"Unknown format"
]
]
]
]
In this example, one evaluation tests the variable $$button. If it has a value from activating one of the buttons in the form, this is used to specify a return format type and passed to a function, GeneralContent. The Wolfram Language code for this function is placed into a separate package to be loaded when the variable is set. GeneralContent calls a function that creates a very simple notebook, MakeNotebook. MakeNotebook generates a notebook using the Wolfram Language Notebook API and the function Developer`UseFrontEnd. In a real-life situation, a more interesting notebook would probably be generated. MSPReturn returns the representation of the notebook to the server with the content type. This is then returned to the browser, which, if suitably configured, will deploy the necessary helper application.
In a more advanced example, the dynamically generated notebook would probably use information sent with the request from the client.
If you wish to return special content and also set a file name to be used with this content, you may use the three-argument form of MSPReturn.
Another way to set the content returned from an MSP script is to use MSPPageOptions. The topic of returning general content is discussed later.
Applets: TextApplet.jsp
This example demonstrates how to call on the services of a Wolfram Language–powered website from an applet. This shows a combination of client and server programming. The section involves some programming in Java.
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this page via http://localhost:8080/webengine/Examples/TextApplet.jsp. (You may have some other URL for accessing your server.) The source for this page is in WolframWebEngine/Examples/TextApplet.jsp and WolframWebEngine/WEB-INF/src/ExampleApplets/TextApplet.java.
First, here is the JSP source:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Text Applet Example</title>
</head>
<body>
<h1>Text Applet Example</h1>
<msp:evaluate>
If[MSPValueQ[$$Compute],
MSPReturn["Date[] returns " <> ToString[Date[]], "text/plain"]
]
</msp:evaluate>
<applet
code="com/wolfram/msp/example/TextApplet.class"
archive = "${msp:evaluate('$ServletContextPath <> "/Resources/applets/example-applet.jar"')}"
width="400"
height="30" >
<param name="ArgumentURL" value="TextApplet.jsp?Compute=True" />
</applet>
Here is an applet that gets a result from the Wolfram kernel.
Hitting refresh will cause the page to update.
</body>
</html>
Here is the source for the applet TextApplet.java:
package com.wolfram.msp.example;
import java.applet.Applet;
import java.awt.*;
import java.net.*;
import java.io.*;
public class TextApplet extends Applet {
public void paint(Graphics g) {
super.paint(g);
try {
URL url = new URL(getDocumentBase(), getParameter("ArgumentURL"));
InputStream in = url.openStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int len;
while ((len = in.read(b, 0, 1024)) != -1) {
out.write( b, 0, len);
}
b = out.toByteArray();
g.drawBytes(b, 0, b.length, 20, 20);
} catch (Exception e) {
System.out.println("Error " + e);
}
}
}
This is a very simple applet; the paint method opens a connection to a URL, the name of which is formed from the document that loaded the applet, and the value of the parameter ArgumentURL, which is passed in from a param tag. This causes the TextApplet JSP to be called and return a computation of the date.
JavaScript: PlotScript.jsp
This example demonstrates how to integrate a Wolfram Language–powered website with JavaScript. It also demonstrates both client and server programming. The section involves some programming in JavaScript.
Note that JavaScript and Java are different languages. JavaScript is a scripting language that is useful for manipulating documents and other features of browsers. Java is a general-purpose programming language that can be used in an HTML document via an applet. The two languages complement each other: JavaScript is useful for manipulating the browser and documents that are open in the browser, while Java has a more sophisticated collection of functions and can draw into the browser window. It is possible for JavaScript and Java to work together.
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this MSP via http://localhost:8080/webengine/Examples/PlotScript/PlotScript.jsp. (You may have some other URL for accessing your server.) The source for this page is in WolframWebEngine/Examples/PlotScript/PlotScript.jsp and WolframWebEngine/Examples/PlotScript1.jsp.
First, here is the source for PlotScript.jsp:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Plotting with JavaScript</title>
<script>
function plot(f) {
win = window.open( "PlotScript1.jsp?fun=" + URLescape(f.fun.value) + "&x1=" +
URLescape(f.x1.value), "plot", "toolbar=none,resizeable=yes,width=450,height=350");
}
</script>
</head>
<body>
<h1>Plotting with JavaScript</h1>
<form action="Plot" method="post">
Enter a function:
<input type="text" name="fun" size="24" value="<msp:evaluate>MSPValue[ $$fun, "Sin[x]^2"]</msp:evaluate>"/> <br/>
Enter a number:
<input type="text" name="x1" size="24" value="<msp:evaluate>MSPValue[ $$x1, "10"]</msp:evaluate>"/> <br/>
<input type="image" name="button" src="../../Resources/Images/Buttons/plot.gif" onClick="plot(this.form)"/>
</form>
This example shows an example of JavaScript and the Wolfram Web Engine.
</body>
</html>
Second, here is the source for PlotScript1.jsp:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title>Plotting with JavaScript</title>
</head>
<body>
<msp:evaluate>
MSPBlock[ {$$fun, $$x1},
MSPShow[ Plot[$$fun, {x,0,$$x1},ImageSize->400]]]
</msp:evaluate>
<form action="Plot" method="post">
<input type="button" value="Close" onClick="window.close()"/>
</form>
</body>
</html>
This is a simple example given to demonstrate how a JSP can work with JavaScript. The initial page, PlotScript.jsp, puts up a page with a form of two text input elements and one submit button. When the button is clicked, it opens a new window that contains the output of PlotScript1.jsp.
Setting Variables: SetBasic.jsp
If you installed Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/SetBasic.jsp. (You may have some other URL for accessing your server.)
This example passes values computed in a JSP into the Wolfram Engine, where they are used for computation by the Wolfram Engine. This example uses the Java programming language, making it different from most MSP examples. Typically, these do not require any Java programming. The source for this page is in WolframWebEngine/Examples/SetBasic.jsp and is shown here:
<%@ taglib uri="http://www.wolfram.com/msp" prefix="msp" %>
<html>
<head>
<title><set> Tag Example</title>
</head>
<body>
<h1><set> Tag Example</h1>
<jsp:useBean id="obj" class="java.lang.Object"/>
<msp:set name="var1" value="${10}"/>
<msp:set name="var2" value="String from Java"/>
<msp:set name="var3" value="${obj}"/>
<msp:evaluate>
Nest[f, x, var1]
</msp:evaluate>
<msp:evaluate>
ToCharacterCode[var2]
</msp:evaluate>
<msp:evaluate>
var3@hashCode[]
</msp:evaluate>
This example shows how a general JSP can set values in the Wolfram Web Engine.
</body>
</html>
In this example, the variables var1, which is an int; var2, which is a string; and var3, which is an object, are created in the JSP. These are then passed to the Wolfram Engine using the msp:set tag. This tag takes two attributes. The name attribute gives the name that the variable will be given in Wolfram Language, while the value attribute refers to the value. Notice how msp:set sends a Java int as a Wolfram Language integer and a Java string as a Wolfram Language string. The Java object is sent as a Wolfram Language object reference. The rules that govern how types are sent from Java to Wolfram Language are exactly those that J/Link uses.
Getting Variables: GetBasic.jsp
If you installed the Wolfram Web Engine as described previously, you should be able to connect to this JSP via http://localhost:8080/webengine/Examples/GetBasic.jsp. (You may have some other URL for accessing your server.)
This example gets values computed in the Wolfram Engine into a JSP, where they are used for processing by the page. The source for this page is in WolframWebEngine/Examples/GetBasic.jsp, and a selection is shown here:
<msp:evaluate>
num = RandomInteger[{1, 10}];
list = RandomReal[{0, 1}, num];
mean = Mean[list];
</msp:evaluate>
<msp:get name="dArray" value="list" />
<msp:get name="dValue" value="mean" />
<table cellspacing="0" cellpadding="0">
<c:forEach var="d" items="${dArray}">
<tr><td>${d}</td></tr>
</c:forEach>
</table>
In this example, the Wolfram Engine generates a list of random numbers and computes the mean. The JSP obtains these values using the msp:get tag. The setting of the value attribute is used as a Wolfram Language expression to be evaluated and transmitted to Java. This is stored as a page context variable using the name attribute setting of the tag. The rules for transmission from Wolfram Language are that the normal J/Link type conversions will be applied, but if none of these apply, then the object will be converted into an object of type com.wolfram.jlink.Expr, a class that is provided by J/Link to represent general Wolfram Language expressions.
The example also makes use of extended JSP tags. It also requires programming in both Java and Wolfram Language. It shows how easy it would be to incorporate MSP into an existing JSP framework.