That's a quite different issue from DTD validation. Yes, when you use
XML-format JSP documents, they must be authored in well-formed XML. This
isn't a Struts tags issue; the same would be true for any JSP custom
action (tag) from any source.
For the case you describe below I'd probably try a combination of
jsp:element and jsp:attribute, or just rely on JSTL, perhaps with a c:set.
L.
Ray Clough wrote:
That is exactly how I do it now, using the xhtml1-transitional dtd. But when
the container assembles the page, it is not valid xhtml, because of the
nested s2-tag elements. For example, the s2 documentation uses this example
to dynamically change the css class of a tr element:
<tr class="<s:if test="#groupStatus.odd == true
">odd</s:if><s:else>even</s:else>">
Aside from the nested double quotes, which would keep it from working
anyway, the s2 tags inside the tr tag will not work with a 'jsp document'
(Sun's name for them), but will work for a 'jsp page'. That leaves anyone
using jsp document format in a world of hurt. The s2 tag guides are full of
jsp page examples, but not a single jsp-document example. My bet is that
whoever initially architected the s2 tags never considered this use case.
The only fall-back is to mix the s2 tags with jstl and jsp-el to achieve the
desired effects, but this takes more lines of code than either s2 or jstl
alone, and of course the s2 tags work best with the s2 data stack.
- rc
Manos Batsis wrote:
Ray Clough wrote:
The failure is in the deployed code. The processor which produces html
from the jsp markup (in tomcat, in this case) will not allow the nested
elements. It is treating everything as pure xml, and the dtd for xhtml
won't allow that type of markup. I could live with it if it was only the
editor which was complaining. I have been trying to use a blend of jsp
el with the s2 tags, but that has problems too.
Use the jsp:output [1] element to declare the DTD you want the response
XHTML to use.
[1] http://java.sun.com/products/jsp/syntax/2.0/syntaxref2022.html#1004130
hth,
Manos
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]