Group Abstract Group Abstract

Message Boards Message Boards

0
|
12.9K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

Show an output in a new webPage in webMathematica?

4 Replies

Hans, it works. I have included a minor change. I have used MSPFormat instead of MSPFormatForCluster.

My intention is to build a more complex case but this is a good starting point

Thank you a lot of

Guillermo

POSTED BY: Hans Michel

Dear Hans, I have followed your instructions but some thing is wrong. The new expand and expandresult are attached (of course txt extension should be removed).

In anycase I think I got your idea. Thanks Guillermo

Guillermo:

I don't currently have access to a machine with a webMathematica instance. So I am going to go on pure memory.

Your version Expand.jsp

<form action="Expand.jsp" method="POST"><p><strong>
          Expand <input type="TEXT" name="expr" align="LEFT" size="10"
              value="${not empty param.expr ? param.expr : 'x+y' }" />
          to the <input type="TEXT" name="num" align="LEFT" size="3"
              value="${not empty param.num ? param.num : '4' }" />
          power.
          </strong></p><table><tr><td><input type="image" src="../images/Template2/compute.gif" name="submitButton" value="Compute" alt="Compute" title="Compute" /></td></tr></table><c:if test="${not empty param.num}"><p><div class="webm-results">Results</div><msp:evaluate>
              Get["Cluster`"];
          </msp:evaluate><div style="padding: 5px; border: 13px solid #CCC; float: left;"><msp:evaluate>
                 MSPBlock[{$$expr, $$num}, 
                     MSPFormatForCluster[Expand[$$expr^$$num], TraditionalForm]
                 ]
            </msp:evaluate></div></p></c:if></form><div style="clear: both;"></div>

I would rewrite as follows:

Expand.jsp

<form action="ExpandResult.jsp" method="POST">
    <p>
       <strong>Expand 
         <input type="TEXT" name="expr" align="LEFT" size="10" value="${not empty param.expr ? param.expr : 'x+y' }" /> to the 
         <input type="TEXT" name="num" align="LEFT" size="3" value="${not empty param.num ? param.num : '4' }" /> power.
       </strong>
    </p>
    <table>
       <tr>
         <td>
          <input type="image" src="../images/Template2/compute.gif" name="submitButton" value="Compute" alt="Compute" title="Compute" />
         </td>
       </tr>
    </table>
</form>

ExpandResult.jsp

<c:if test="${not empty param.num}">
    <p>
       <div class="webm-results">Results</div>
       <msp:evaluate>
          Get["Cluster`"];
       </msp:evaluate>
       <div style="padding: 5px; border: 13px solid #CCC; float: left;">
         <msp:evaluate>
              MSPBlock[{$$expr, $$num}, 
                  MSPFormatForCluster[Expand[$$expr^$$num], TraditionalForm]
              ]
          </msp:evaluate>
       </div>
    </p>
</c:if>
<div style="clear: both;"></div>

The HTML form element's action attribute is what helps with the redirection. So you just need another file called "ExpandResult.jsp" You can try this first by having the action on Expand.jsp route to a blank "ExpandResult.jsp" page. Then fill in the page with the parameters and msp calculations.

POSTED BY: Hans Michel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard