aspose file tools*
The moose likes Struts and the fly likes Sintaxis problem with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sintaxis problem with struts" Watch "Sintaxis problem with struts" New topic
Author

Sintaxis problem with struts

Mario Romero
Greenhorn

Joined: Aug 06, 2007
Posts: 18
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 ]

.NET & JSP developer for <a href="http://www.grupocartuja.com" target="_blank" rel="nofollow"> Grupo Cartuja</a><br /> <br />Currently moving the webpage from ASP to Struts (mostly the Intranet)
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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[].


Merrill
Consultant, Sima Solutions
Mario Romero
Greenhorn

Joined: Aug 06, 2007
Posts: 18
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

Joined: Feb 15, 2005
Posts: 4864
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

Joined: Aug 06, 2007
Posts: 18
Sorry I was on vacation and I couldn�t reply.
I think I�m getting struts... slowly Thanks again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sintaxis problem with struts