Hi,
Is it possible to send pages to a browser depending on the processing status
of an action? Lets say you have to process a long operation in the
background such as a credit card validation or the like, is it possible to
show the user an intermediate page telling him that some work is in progress
and then show the result page when it is generated?
In the Action class it looks like this:
// test if session is valid
af = super.validateForm(form, mapping, request);
if (af != null) return af;
// test if a form has already been delivered
if ((ContainerName == null) || (ContainerName.length() < 1)) //show
form
{
saveToken(request);
return (new
ActionForward("/Templates/Forms/ShowEnumNTGGForm.vm"));
}
if (this.isTokenValid(request))
{
resetToken(request);
//
****************************************************************************
***********************
// START PROCESSING HERE THIS COULD LAST 30 SECONDS OR
MORE....
// IF I ADD SOMETHING LIKE A new ActionForward("some status
message URL"); THE
// FOLLOWING CODE WILL EXECUTE BUT THE FORWARD AT THE BOTTOM
WILL NEVER
// REACH THE BROWSER !
//
****************************************************************************
***************************
try
{
container = getNTContainer("Domain", ContainerName,
request);
request.setAttribute("NTContainer", container);
} catch (SmartSolException e)
{
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.exception.smartsol", new
Integer(e.ErrorCode).toString(), e.File ,e.ErrorMsg));
}
} else
{
errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.BePatient"));
}
// Report any errors we have discovered back to the original form
af = super.processErrors(errors, mapping, request);
if (af != null)
{
log.debug("finished perform with errors.");
return (af);
}
// Forward control to the specified success URI
log.debug("finished perform with success");
return (new ActionForward("/Templates/NTAccounts/EnumNTGG.vm"));
------- end quote --------------------------
How can this problem be solved?
Many thanks!
Thomas
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>