21 Reputation

2 Badges

18 years, 186 days

MaplePrimes Activity

These are answers submitted by Bill


The code for the Maplet runs on the Server. Only the visual representation of the Maplet is 'running' on the Client browser. So the path to the JDBC jar should point to the jar where it exists on the Server file system. Also the owner of the Tomcat process should be given read access to this directory.

Bill H

In MapleNet 11, there was a bug in the 2D MathContainer that incorrectly handled the math and caused the Maple kernel performing the calculation to abort.

This was fixed in the MapleNet 11.01 release. I think the MapleOracles site uses MapleNet 11.01


The MapleNet server is started with an argument to load an extra Maple Initialization file specifically for Maplenet.
For MapleNet 10.5 and up, this file is located at     <Tomcat>/webapps/maplenet/WEB-INF/ini/maplenet_init To add your own libraries, create or choose a directory, e.g /usr/local/maplenet/custom, and add a Maple "libname" expression to the end of the maplenet_init file such as     libname := "/usr/local/maplenet/custom", libname; MapleNet will add this directory to the ones it searches for when it loads Maple libraries.
Now download your libraries to the /usr/local/maplenet/custom directory using FTP, SCP, WebDav or some similar mechanism. Ensure that the directory has read permission for the user account that is running the Tomcat server.
Doug I have looked into the problem of these non-ascii characters in MapleNet Maplets. What was found was that the XML parser used by Maple to send the Maplet definition across the network to MapleNet has problems handling non-ascii characters. (This conversion is not required in the worksheet or MapletViewer). At the moment I have not found any settings (client or server side) that workaround the problem. However, I successfully tested the umlaut-1252.maplet and 2 others from your WebAlt Calculus site using a beta version of MapleNet 11. This version uses a corrected parser and Maplet library. MapleNet 11 will be released as part of the upcoming Maple 11 package. Bill Huiskamp Maplesoft
Maple Plots are exported to JPEG files inside of MapleNet using Java Code. This was done so that plot files would be generated relative to the Web Root of the server and therefore accessible as an <IMG> tag via the resultant HTML page. Currently there is no option for other formats. So changing Maple's plotting through plotsetup will not work. In fact issuing plotsetup or interface(plotdevice...) commands will cause errors as MapleNet in some instances requires that the plot device be specifically configured so that it can intercept the plot for redirection to the user. An alternative method for displaying plots is to use the <maple:plot> tag.
Currently there is no simple interface for generating pretty printed equations in a JSP page. It is possible to combine output from MapleNet 10.5 with the publicly available MathML viewer to view generated output. You could add something similar to the following HTML Applet snippet to your JSP.
  <applet code=com.maplesoft.mathmlviewer
    <param name="eq" 
        "<maple:statement safeHTML="false" quotes="false" >
Convert the Maple expression with the MathML[ExportContent]() function into a MathML string. The attribute safeHTML='false' prevents MapleNet from converting the MathML into HTML entities such as &lt;, &gt; etc The quotes='false' attribute strips the leading and trailing double quotes from the generated MathML string. The code for the MathML viewer is accessible using the URL shown in the codebase parameter. Note: not all browser support the <applet> tag. Older browsers may use the <object> or <embed> tags. Bill
If you can stand to use a small amount of Java in your JSP document along with using the <maple:xxx> tags then here is an example to try. JSP Java Primer: Anything between the tags <% and %> is a JSP Scriplet in Java that is handled by the JSP parser (ie not MapleNet). It is evaluated but generally does not cause output to the resulting Web Page Anything between the tags <%= and %> is JSP expression again in Java, that is output to the Web Page The tags <!-- to --> are JSP comments. The code shown below adds double quotes to the expression extracted from the form (field_1) and then assigns the quoted string to a Maple variable, eqn. Your expression is now a String. You would then write your Maple code expecting that the expression is in a String format and use the parse() function to evaluate when desired. The code show in BOLD is all that you really need to worry about. It pulls the expression using the request.getParameter() JSP function and assigns it to a Java String, f1. Then another Java String, f1Quoted, is constructed inserting literal double quotes so that it can be assigned to Maple using the <maple:assign> tag. Writing f1Quoted to the default= part of the assign is done using the JSP <%= ... %> expression syntax. Also note that param=dummy does not exist so that the default is always taken. Here is the code: (cut and paste into your JSP example)
<%@ taglib prefix="maple" uri="/maplemath.tld" %>
<maple:init scope="session" debug="false"/>

<!-- Use Java to get the current value of field_1
     Initially it is null when the page first loads.
     Otherwise it takes the value submitted by the form
  String f1 = request.getParameter("field_1");
  if( f1 == null) {
    f1 = "";
  String f1Quoted = "\"" + f1 + "\""; 
<!-- Use JSP Assigment to set the default value from f1Quoted<
      Parameter dummy does not exist so default will always be used
<maple:assign param="dummy" variable="eqn1" default="<%= f1Quoted %>" />

    <title>Test Maple </title>
    <h2>Test of inputting unevaluated Maple</h2>
    <i>Try inputting int(x,x), sum(n,n=1..4) or evalf(Pi) for example</i><br><br>
    <!-- This is the form to submit the expression with only two (2) 
         parameters: field_1 and submit_1
    <form method="post">
      Enter Maple Expression: <input name="field_1" width="60" value="<%= f1 %>" >
      <br><input type="submit" name="submit_1" value="Go!">

    <br>The value is <b><%= f1Quoted %></b>

  <br>1. The variable eqn is  <b><maple:statement>eqn1</maple:statement></b>
  <br>2. The result of parse(eqn) is <b><maple:statement>parse(eqn1)</maple:statement></b> 
  <br>3. The result of parse(eqn,statement) is <b><maple:statement>parse(eqn1,statement)</maple:statement></b> 
End of Code Sample
If you enter sum(n,n=1..4) into the form and press the Go button you should end up with the results:
                           The value is "sum(n,n=1..4)"

1. The variable eqn is "sum(n,n=1..4)"
2. The result of parse(eqn) is sum(n, n = 1 .. 4)
3. The result of parse(eqn,statement) is 10
By saying "but I cannot see it correctly in a jsp page" do you mean that you see the literal <math> etc etc </math> instead of a rendered equation? The <maple:statement> tag currently converts certain output characters to their "safe" html equivalent so that the math output does not interfere with the html tags generated by the JSP engine. This way the equation
  b < a
does not get parsed (by your browser) as the start of an Anchor <a> tag. The chars &, <, > and " get converted to &amp;, &lt;, &gt; and &quot; respectively, which the browser displays as the equivalent single character. There is an enhancement request in for MapleNet to be able to disable this conversion programmatically to allow the JSP writer to output literal MathML or even HTML (e.g <br>) to control formatting.
Page 1 of 1