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 JSP and the fly likes Custom JSP Tag 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 » Java » JSP
Bookmark "Custom JSP Tag" Watch "Custom JSP Tag" New topic
Author

Custom JSP Tag

Khsitiz sharma
Greenhorn

Joined: Jun 03, 2008
Posts: 7
Hi all!

I'm new to java development environment and I want to know how to create a custom jsp tag which iterate over the collection it contains.
for example let us suppose that we have a HashMap<String,Student> lhashMap.
Here Student is a java bean class which have name,rollno and marks attributes.

what I want is a tag which iterates over the HashMap

Please help me
thanks in advance
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Hi Khsitiz sharma,
Welcome to JavaRanch. Unfortunately, the Cattle Drive doesn't have any assignments about custom jsp tag creation, so I'm going to move your question to the Jsp forum.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Do you want to do this as an academic exercise or do you just want the tag?

If you just want the tag, look at JSTL's c:forEach tag.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Custom JSP Tag
 
Similar Threads
Embedding Custom Tag in Java Code
Doubt in Custom Tag Question !
need help to understand question
Iterate HashMap in jsp - Struts2
Custom Tags Vs Performance