Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Murach's Java Servlets and JSP this week in the Servlets 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: 1628
    
  23

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
 
Don't get me started about those stupid light bulbs.
 
subject: List attribute on Simple Tag Handler
 
Similar Threads
Creating and populating a List of javaBeans in a JSP w/o using scriptlets
Help with custom tags
problem from HFSJ book
Custom tag does not render.
Setting bean in Simple tag attribute