See below...
> From: news [mailto:[EMAIL PROTECTED]] On Behalf Of Davor Cengija
> Justin Ashworth wrote:
> > Actually, that's what I tried at first but then I realized that I
> > would need a default form, and I would have to define that "dummy"
> > form. To me, this seemed more like a kludge than a solution. Is
> > there a way to keep that form tag in there without having
> to define a
> > dummy form?
>
> If I understand you correctly, you're trying to acomplish
> something like
> this:
>
> // conditional is true
> <form action="action">
> Some text
> <input type="text" name="somename">
> </form>
>
> and if your conditional is false you want to have this:
> Some text
> <input type="text" name="somename">
>
> Well, in the latter case you have an invalid html, since no
> input elements
> could exist outside the form element.
>
> You might want to minimize the form's scope, e.g.
>
> Some text
> <c:if...>
> <html:form...>
> <html:text .../>
> </html:form>
> </c:if>
>
> But maybe I don't understand you completelly :-)
Thanks, but that's not quite what I'm trying to do. It is more like
this:
<c:if test="condition">
<html:form...>
</c:if>
... JSP code ...
<c:if test="condition">
<!-- All form elements would be enclosed in this condition. -->
<html:text ...>
</c:if>
... JSP code ...
<c:if test="condition">
</html:form>
</c:if>
However, this is invalid JSP code. You can't start a tag and not finish
it before the parent is closed. If I could do the test condition in the
html:form tag itself, then I could do...
<!-- Only print the <form> tag if condition is true -->
<html:form test="condition">
... JSP code ...
<c:if test="condition">
<!-- All form elements would be enclosed in this condition. -->
<html:text ...>
</c:if>
... JSP code ...
</html:form>
I may end up subclassing HtmlForm to do what I need to do. If condition
evaluates to true, I would still evaluate the JSP body, but I wouldn't
print the start and end tags. This seems like a limitation of JSP
and/or Struts...
Thanks,
Justin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]