This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Help with custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Help with custom tags" Watch "Help with custom tags" New topic
Author

Help with custom tags

Aashima Arora
Ranch Hand

Joined: Jun 15, 2010
Posts: 59

A simple tag with attribute;

there is a movie class used in tag handler in tag handler class...

i dont know whether it should be used as a bean or in a scriptlet . its unclear whats happeng in k&b pg 521
mytag2.jsp


awesome_tag.tld


Movie.java


SimpleTag3.java




We are using tags to eliminate scriptlets. Now in this,without using a scriptlet how do i declare a List which i can then use as an attribute .??? may be i am forgetting something but at the moment i cant recall what to do.

Thanks A LOT !
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 2007
    
  39

Hi Aashima,

i dont know whether it should be used as a bean or in a scriptlet

The idea is to create a Servlet (that instantiates the List of movies and than adds it as an attribute to the request) and to forward from that Servlet (by using a RequestDispatcher) to the jsp.

You should define the Servlet (<servlet>) in your web.xml, and use the <url-pattern> of your <servlet-mapping> to access it.

Regards,
Frits
Aashima Arora
Ranch Hand

Joined: Jun 15, 2010
Posts: 59

Ohhhhh!!! That was the missing link! Thank You So Much Frits! You cleared all my doubts ! :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with custom tags
 
jQuery in Action, 3rd edition