This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes Error: According to TLD, tag html:hidden must be empty, but is not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error: According to TLD, tag html:hidden must be empty, but is not" Watch "Error: According to TLD, tag html:hidden must be empty, but is not" New topic
Author

Error: According to TLD, tag html:hidden must be empty, but is not

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,
I am using <html:hidden> tag

<html:hidden property="method" value="search"/>
<html:hidden property="param1"><bean:write name="param1"/></html:hidden>

Error i get is:

According to TLD, tag html:hidden must be empty, but is not
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:130)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1768)

Please help me out with this
Thanks,
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
I think it is fairly self explanatory.
You can't specify the value of an html:hidden component by nesting a String value. They didn't allow for that.

You will just have to use the value attribute and a runtime expression. either <%= expr %> or If you have a JSP2.0 container then an EL ${expr}

<html:hidden property="param1" value="${param1}"/>
or
<html:hidden property="param1" value="<%= pageContext.findAttribute("param1") %>"/>

you might have to convert/cast the value to a String in the <%= expr %> to be a string.
Cheers,
evnafets
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error: According to TLD, tag html:hidden must be empty, but is not