56
<%@ page language="java"  %>
<%@ taglib uri="/webMathematica taglib" prefix="msp" %>
Set Example

Set Example

This jsp uses the MSP Taglib to demonstrate passing
Java values to Mathematica.

<% 
  int num = 10;
  Object obj = new Object();
%>
  Nest[ f, x, var1]
  Characters[ var2]
  var3@hashCode[]
In this example, a variable num, which is an int,  str, which is a String, and obj, which is an Object, are created in
the  JSP.  These  are  then  passed  to  Mathematica  using  the  msp:set  tag.  This  tag  takes  two  attributes,  the  name
attribute  gives  the  name  that  the  variable  will  be  given  in  Mathematica,  while  the  value  attribute  refers  to  the
value. If  the variable  is  of a  primitive  type, such  as  int, char,  or double,  then it needs  to use the  appropriate value
attribute,  such  as  intValue,  charValue,  or  doubleValue.  Notice  how  msp:set  sends  a  Java  int  as  a
Mathematica integer  and  a Java  String   as a Mathematica string.  The Java Object  is  sent as a  Mathematica  object
reference. The rules that govern how types are sent from Java to Mathematica are exactly those that J/Link uses.
 .
<





New Page 1








Home : About Us : Network : Services : Support : FAQ : Control Panel : Order Online : Sitemap : Contact : Terms Of Service

 

Our web partners:  Jsp Web Hosting  Unlimited Web Hosting  Cheapest Web Hosting  Java Web Hosting  Web Templates  Best Web Templates  Web Design Templates  Interland Web Hosting  Cheap Web Hosting  Filemaker Web Hosting  Tomcat Web Hosting  Quality Web Hosting  Best Web Hosting  Mac Web Hosting

 
 

Virtualwebstudio. Business web hosting division of Vision Web Hosting Inc. All rights reserved

Comcast Web Hosting