This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes List attribute on Simple Tag Handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "List attribute on Simple Tag Handler" Watch "List attribute on Simple Tag Handler" New topic
Author

List attribute on Simple Tag Handler

stefania ferrarelli
Greenhorn

Joined: Jul 26, 2009
Posts: 29
Hi,
I try to make a List attribute on TLD of a Simple Tag but when I iterate over it, EL expressions show nothing.Any doubts:
-when I make the attribute I need to choose Object on netbeans :is it correct?


-is it correct to change the Object argument type of the default setter method to a List type ?


-the attribute is movieList but can I set another attribute - movie - on JspContext, regardless to TLD?


In general, can I set other attributes on JspContext() in addition to those declared on TLD? It is not clear to me what is my mistake...
Stefania

Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1529
    
  22

Hi Stefania,

Let me try to give you an answer:
-when I make the attribute I need to choose Object on netbeans :is it correct?

You can make it work, but you should use the type you are using (i.e. java.util.List)
-the attribute is movieList but can I set another attribute - movie - on JspContext, regardless to TLD?

No, you can't.

This won't work:

Attribute name invalid for tag Simple5 according to TLD

You are not setting an attribute but filling the body of the tag.

Regards,
Frits
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: List attribute on Simple Tag Handler
 
Similar Threads
problem from HFSJ book
Help with custom tags
Setting bean in Simple tag attribute
Custom tag does not render.
Creating and populating a List of javaBeans in a JSP w/o using scriptlets