Struts tag <html:label> ?

O

Owen Jacobson

Hi,

In the Struts documentation
 http://struts.apache.org/1.x/struts-taglib/tagreference.html#html:label
there is a tag: <html:label> listed.

I have Struts 1.2.9, but when I try to use this tag,
it seems it doesnt recognize it and gives me:

PWC6142: No tag "label" defined in tag library imported with prefix
"html"

Other <html:...> tags work fine.

Anyone has a clue what the problem is?

I can find no reference to a tag called 'label' in the Struts 1.3.9
html taglib's documentation:
http://struts.apache.org/1.3.9/struts-taglib/tlddoc/html/tld-summary.html

Perhaps it existed in a previous version but was removed; many of the
Struts taglib tags duplicate functionality that's since been added to
JSTL or JSP EL.

-o
 
G

grz01

I can find no reference to a tag called 'label' in the Struts 1.3.9
html taglib's documentation:
 http://struts.apache.org/1.3.9/struts-taglib/tlddoc/html/tld-summary.....

Perhaps it existed in a previous version but was removed; many of the
Struts taglib tags duplicate functionality that's since been added to
JSTL or JSP EL.

-o


Hmm... funny... this one is still useful, I think, since it connects a
HTML-form element with an ActionForm in Struts.
No non-struts tag will do that.
Sure, you can work-around it -- but not as elegant...
 
G

grz01

What ActionForm element corresponds to a <label>?

ActionForm element? It would be a normal String field with getter/
setter method.
From the programs viewpoint, I would expect it to behave just like the
"hidden" field (but maybe I'm wrong...?)
It's just a text that the user cannot change; difference only being
that the text is visible to the user.
Calling leaner, better code a "work-around" and "not as elegant" doesn't make
it so.  Please substantiate those comparatives.

Well, just compare it to what you had, if the "hidden" element didnt
exist when you wanted it.
You would have to make a "less elegant" "workaround" I guess...

I dont see a good reason for removing it, if it was once there -- you
would also break old code?
Owen is right that <html:label> seems to have gone away, but the version
number he cited was different from the one you did.  Try viewing your Struts
JAR with 'jar tf' and see if the label tag class is even in there.  What does
that show you?

Owens link says 1.3.9, while mine said 1.x.
I have 1.2.9 which I got with a Netbeans bundle downloaded a couple of
months ago
and, no, there is no LabelTag.class in the jar.
What happens if you just use a plain HTML <label> tag instead of the
non-existent Struts <html:label> in your code?

Yeah, that may be a "workaround" --- only then it doesnt get sent back
and forth by the ActionForm, so more code = "less elegant"
 
G

grz01

A so-called "hidden" field, actually a <text> element with an attribute
indicating that it's hidden, is an input field and does contribute to the HTTP


A <label> is more than that, in that it can be tied to an input field via its
'for' attribute, and less than that, in that a <text> element is an input and
a <label> element is not.  It is a tag element, unlike contained text.  In




Would you?



x == 3.9


More evidence that Owen is on to something.



I don't see how the ActionForm has anything to do with it.  How about using
JSTL to fill the label content, if it's dynamic?


Umm... yeah... ok... I guess you got some points there, Lew :)
Thanks for your input.
 

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
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top