?
Solved

custom tag tutorial

Posted on 2006-05-12
7
Medium Priority
?
288 Views
Last Modified: 2013-11-24
can someone point me to a tutorial that will show how to write a very simple custom tag that just spits out some html and iterates over a specified form bean property?
0
Comment
Question by:wrynn
7 Comments
 
LVL 11

Accepted Solution

by:
fargo earned 600 total points
ID: 16667819
here is basic tutorial for custom tag
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags.html#wp74641

if u click on further pages, one is there for iteration too.
0
 
LVL 23

Assisted Solution

by:Siva Prasanna Kumar
Siva Prasanna Kumar earned 600 total points
ID: 16668397
0
 

Author Comment

by:wrynn
ID: 16668562
i guess what i need to know is if im just making a single .tag file and i want to have the tag take a specified bean as a attribute and also take the property of that bean that u want to iterate
and the tag uses those attributes to cycle through the items in that property using a foreach
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Assisted Solution

by:Manikandan Thiagarajan
Manikandan Thiagarajan earned 300 total points
ID: 16668604
0
 

Author Comment

by:wrynn
ID: 16669057
i call the tag like this:

<widget:dropdown bean="theForm" property="xFormOptions" />


and my tag looks like this:

<%@ attribute name="bean" %>
<%@ attribute name="property" %>

<c:set var="tempString" scope="request" value="item.${property}" />

<c:forEach var="item" begin="0" items="${bean}">
 
 <c:out value="${tempString}" />
   
</c:forEach>

but its just outputting the name of the variablee but not the actual data inside the variable.  its just printing the string  "item.xFormOptions" once.  what i want it to do is actually iterate through the data and output it like its supposed to.  
0
 

Author Comment

by:wrynn
ID: 16670630
anyone?
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16672319
try this

replace

   <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

with

   <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>

refer this

http://forum.java.sun.com/thread.jspa?threadID=666728&messageID=3901301
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question