David Johnson wrote the following on 7/11/2005 2:23 PM:
Joe
Oh this one sounds good. I'm not sure how I'd actually DO that though.. can
you provide more info? All my pages are tiles definitions right now. How
would I cause the response page to use the new target (conditionally)?
what about something like... one JSP page for form.
<html>
<html:form action="yourAction>
//form inputs plus the hidden.. first submit is just validating
<input type="hidden" name="dispatch" value="validateMe">
</html:form>
//bottom of JSP .. although probably will work fine up top
<c:if test="${openPDF}">
<script>
document.forms[0].target=newTarget;
document.forms[0].dispatch.value="pdfProcess";
document.forms[0].submit();
</script>
</c:if>
</html>
Your dispatch Action:
validateMe(...) {
form.validate()...
//if ok ...
request.setAttribute("openPDF",true);
//else if failed...save errors
request.setAttribute("openPDF",false);
//forward to same JSP
}
pdfProcess(..) {
//normal proces of form data to create your PDF or whatever
//forward page to display PDF
}
Key is to call validate manually in your action.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]