• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with custom tags

 
Aashima Arora
Ranch Hand
Posts: 59
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 2266
76
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ohhhhh!!! That was the missing link! Thank You So Much Frits! You cleared all my doubts ! :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic