52
3.9 Applets: TextApplet.jsp
This  example  demonstrates  how  to  call  on  the  services  of  a  Mathematica powered  web  site  from  an  applet.  This
shows a combination of client and server programming. The section involves some programming in Java.
If  you  installed  webMathematica  as  described  
above
,  you  should  be  able  to  connect  to  this  MSP  via
http://localhost:8080/webMathematica/Examples/TextApplet.jsp.  (You  may  have  some  other  URL  for  accessing
your  server.)  The  source  for  this  page  is  in  webMathematica/Examples/TextApplet.jsp  and  web 
Mathematica/WEB INF/src/ExampleApplets/TextApplet.java.
First, here is the JSP source.
<%@ page language="java"  %>
<%@ taglib uri="/webMathematica taglib" prefix="msp" %>
Live 3D Plotting
 
Applet Test

Here is an applet that gets a result from Mathematica:

 
If[ MSPValueQ[ $$Compute],
MSPReturn[ "Date[] returns " <> ToString[ Date[]], 
"text/plain"]]

code="TextApplet" 
archive = 
" $WebApplication <> 
"/Resources/applets/MSPExamples.jar""  
width="400"
height="30" >
 

Hitting refresh will cause the page to update.
Here is the source for the applet TextApplet.java.
 .
<





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