This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


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 "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
Bartender

Joined: Apr 07, 2010
Posts: 1629
    
  23

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
 
Similar Threads
Simple Tag Handler - doubt - when is doTag() called ?
What's wrong with my customTag?
Setting bean in Simple tag attribute
I have a trouble in Custom tag and I can't find any mistakes, someone else can help me to find out ?
Doubt in HFSJ..pg 511 creating simple tag with attribute