This section will discuss how to convert between MSP scripts and JSPs that use the MSP Taglib. First, most Mathematica commands that can be used in an MSP can also be used in a JSP, so it is possible to convert from an MSP to a JSP. The only Mathematica command that cannot be used in a JSP is MSPInclude. If you need to use this functionality, it should be modified to use jsp:include. However, the JSP mechanism is richer than the MSP mechanism, consequently, some JSPs are harder to convert back to MSPs.
8.1.1 Converting an MSP to a JSP
This will be explained with the Plot.msp example, the text of which is shown below.
All evaluations must be contained inside a single <msp:allocateKernel>.
<%Mathlet expr %> must be replaced with <msp:evaluate>expr</msp:evaluate>.
No change to the Mathematica computations is needed other than changing uses of MSPInclude to use jsp:include.
If Mathematica packages are loaded from within the MSPDirectory, these should be placed in a directory in WEB-INF/Applications.
8.1.2 Converting a JSP to an MSP
It is possible to convert from a JSP that uses the MSP Taglib back to an MSP by simply reversing the steps shown in the previous section. This will only work if no other JSP features are being used and if the only MSP Taglib tags that are used are msp:allocateKernel and msp:evaluate.