Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sintaxis problem with struts

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I�m having a problem with sintaxis when inserting a bean into a struts tag.
This is a sample:

elemento is an user bean that I�m iterating.
This renders in the html source code this:

Note that after Crear Rol it fails to write the > end tag too.
How can I fix it?

Thanks
[ August 09, 2007: Message edited by: Mario Romero ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't nest one custom tag inside another, so what you've written is invalid.

Also, looking at your code, it looks like you're probably iterating over a list and creating a collection of related checkboxes. If this is the case, you should be using the html:multibox tag, rather than html:checkbox.

Here's what I'd recommend to fix it. Putting something in the body of a html:multibox tag is another way of specifying a value attribute. So, the following should work:

Note that in this case the check property should be of type String[].
 
Mario Romero
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great help as always Merrill. Thanks.

But I�m wondering, how can I "inyect" a value coming from the Action in a struts tag?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Injection of values in Struts tags is done automatically, so you don't have to worry about it. For example, suppose your ActionForm has a property firstName and you have the tag <html:text property="firstName" /> in your JSP. If you want the value of this tag to be "Mario" when the page is displayed, all you have to do is set the firstName property of the ActionForm to "Mario" prior to displaying the page, and the Struts tag will pick up the value automatically.
 
Mario Romero
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry I was on vacation and I couldn�t reply.
I think I�m getting struts... slowly Thanks again
 
What are your superhero powers? Go ahead and try them on this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic