<% response.setContentType( "text/xml" ); %> <%@ taglib uri="/WEB-INF/tlds/omcore-taglib.tld" prefix="omcore" %> <%@ taglib uri="/WEB-INF/tlds/util-taglib.tld" prefix="util" %> OpenMath Integration Service <%@page import="java.io.*,antlr.*, nl.tue.win.riaca.openmath.lang.*, nl.tue.win.riaca.openmath.io.*, com.web4math.axis.maxima.client.*, at.ac.uni_linz.risc.openmath.expressions.parser.*"%> <%@page session="true" %> <% // Get access to service properties WebMaximaService service = new WebMaximaServiceLocator(); // Get port type WebMaxima port = service.getWebMaxima(); boolean firstTime = false; String fData = request.getParameter("fData"); if (fData == null) { firstTime = true; fData = "1+3*4*x"; } %>

Enter a simple arithmetical or polynomial expression in variable x and then press the integrate button.

Expression:

<% // Determine if this is the first time the JSP is run if (firstTime || (fData == null) || (fData.equals("")) ) ; //do nothing else{ // Get decoding StringBuffer tBuffer = new StringBuffer(); String ret = null; // clean input string char tCh; for (int i = 0; i < fData.length(); i++) { tCh = fData.charAt(i); if ( (tCh != '\n') | (tCh != '\t') | (tCh != '\r') ) tBuffer.append(tCh); } if ( !( (tBuffer.toString()).endsWith( ";" ) ) ) tBuffer.append( ";" ); /* UnivExprLexer tLexer = new UnivExprLexer ( new DataInputStream( new StringBufferInputStream( tBuffer.toString( ) ) )); UnivExprParser tParser = new UnivExprParser( tLexer ); tParser.expr(); CommonAST tAST = (CommonAST) tParser.getAST(); UnivExprTreeWalker walker = new UnivExprTreeWalker(); String tObj = walker.expr(tAST); OMXMLReader tReader = new OMXMLReader( tObj ); OMObject tObject = tReader.readObject(); OMObject tAppl = (OMObject) tObject; */ ret = (String) port.phrasebook("EVAL_NATIVE_NATIVE",tBuffer.toString()); //System.out.println("ret is " + ret); if (ret == null){ ret.concat("[NOTE: Result was null. Please verify that the service was deployed using the UtilityServicesSetup command.]"); System.out.println("ret was NULL, set to" + ret);} %>

The indefinite integral of <%=Str%> is <%=ret%>

<%=oRes%>

<%}%>