Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 79227 invoked from network); 15 Aug 2000 12:10:03 -0000 Received: from lugh.relay.co.uk (194.72.177.254) by locus.apache.org with SMTP; 15 Aug 2000 12:10:03 -0000 Received: from enetgroup.co.uk ([194.72.178.7]) by lugh.relay.co.uk (Netscape Messaging Server 4.15) with ESMTP id FZC1QT00.B01 for ; Tue, 15 Aug 2000 12:08:53 +0000 Message-ID: <399932AC.3090702@enetgroup.co.uk> Date: Tue, 15 Aug 2000 13:08:12 +0100 From: Rachel Greenham User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16 i686; en-US; m18) Gecko/20000814 X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Using expressions in tag attributes Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Should I be expecting this sort of thing to work? <% String name="wibble"; %> ie: using an expression in an attribute to a taglib tag. It doesn't work, and I think I can see why, but as it does on HTML it would be intuitive if it did. Or is there another way of doing what I'm trying to do. Say for instance I wanted to use this to list all variables: <% Iterator i = myobj.getVariableNames(); while (i.hasNext() { String name = i.next().toString(); %>
<%=name%> <% } %> Actually, on reflection it looks like a bit of an ugly mix - if I'm putting that much Java in anyway, I may as well not be using the tag to get the variable, just <%=myobj.getVariable(name)%>, or write another tag for looping through variables. -- Rachel