I am trying to use custom tags in my JSP. I have illustrated the
simplified version of my problem below. Can anyone tell me how to go
about doing it?

Problem definition:
--------------------
I have a JSP in which I retrieve a hashtable from request object using
request.getAttribute() method. I need to display the commodity details
present in the Hashtable using custom tags.

Input Hashtable contents(given in Key: Value format)
---------------------------------------------------

"Commodity.length": "2"
"Commodity[0].Weight": "34"
"Commodity[1].Weight": "43"

Please note that the above keys are not Java arrays, they are just
strings

Required JSP format
-------------------

<gan:array name = "Commodity">
<table>
  <tr>
  <input type='text'
         name='<gan:getFullNameForItem name="Weight" />' 
         value='<gan:getValueForItem name="Weight" />'   />
  </tr>
</table>
</gan:array>


Desired HTML output:
--------------------

<table>
  <tr>
  <input type='text'
         name='Commodity[0].Weight' 
         value='34'  />
  <input type='text'
         name='Commodity[1].Weight' 
         value='43'  />
  </tr>
</table>


My question:
------------
How can I go about implementing the tags starting with "gan:"? 

Please note that there can be nested gan:array tags. 

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to