Struts: XHTML support

T

Tim Slattery

I'm writing apps in Struts, and our pages are supposed to be xhtml
1.1. We're using Struts 1.1, which has an "xhtml" attribute for the
"html" tag. When you use that tag, you get a "lang" attribute in the
rendered html tag, which is not allowed in xhtml 1.1. And you get a
"name" attribute in the form tag, which is also not allowed.

I've tried Struts 1.3.5, which is better. You don't get a "name"
attribute in the form tag, instead the form bean name is put into an
id attribute. I've tried to specify my own id attribute
(styleId="something"), that causes page rendering to stop at the form
tag, with no error message. Also, the "lang" attribute in still in the
html tag

I haven't tried 1.3.8 yet, is that any better?

Also, a general gripe: The taglib documentation at
http://struts.apache.org/1.3.8/struts-taglib/tagreference.html is a
mess! many of the & characters have been changed to entities(&).
In general a good idea, but not when the & is itself the first
character in an entity! Also < and > characters delimiting HTML tags
seem to have been turned into entities. You get stuff like this:

<p><strong> Define An Input Form </strong></p> <p> Renders an HTML
&lt;form&gt; element whose contents are described by the body content
of this tag. The form implicitly interacts with the specified request
scope or session scope bean to populate the input fields with the
current property values from the bean. </p> <p> The form bean is
located, and created if necessary, based on the form bean
specification for the associated <code>ActionMapping</code>. </p>

Ugh!
 
T

Tim Slattery

I haven't tried 1.3.8 yet, is that any better?

So now I've tried 1.3.8. I copied the libraries in, recompiled my
*.java modules, redeployed. Now it doesn't run at all. I get this:

Parsing of JSP File '/index.jsp' failed:
--------------------------------------------------------------------------------
/index.jsp(3): Error in using tag library
uri='http://struts.apache.org/tags-html-el' prefix='html-el': type
mismatch for property 'filter', for Tag class
'org.apache.strutsel.taglib.html.ELOptionTag': tld says boolean,
implementation type is java.lang.String
probably occurred due to an error in /index.jsp line 3:
<%@ taglib uri="http://struts.apache.org/tags-html-el"
prefix="html-el" %>

The "taglib" directive quoted at the bottom of that paragraph is in
the page and has been forever, it has not changed. Is the
struts-el-1.3.8.jar library really screwed up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top