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.