Found the solution, seems like u can't use id attribute of logic:iterate tag as a scriplet variable. So first I had to define a page scope scriplet variable using bean:define tag and then use it. So following code worked for me

<logic:iterate id="field" name="fields">
<bean:define id = "fieldvar" name ="field" property="name" />
<% String name = "value(" + fieldvar + "_required"); %>
<do something with name>
</logic:iterate>

Thanks for everybody's help
Rajiv









From: "Pani, Gourav" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: RE: getter doesn't work in scriplet
Date: Mon, 20 Jan 2003 14:59:31 -0500
MIME-Version: 1.0
Received: from exchange.sun.com ([192.18.33.10]) by mc5-f21.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 20 Jan 2003 11:59:53 -0800
Received: (qmail 28103 invoked by uid 97); 20 Jan 2003 20:01:07 -0000
Received: (qmail 28090 invoked by uid 98); 20 Jan 2003 20:01:06 -0000
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Struts Users Mailing List" <struts-user.jakarta.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
X-Antivirus: nagoya (v4218 created Aug 14 2002)
Message-ID: <[EMAIL PROTECTED]>
X-Mailer: Internet Mail Service (5.5.2653.19)
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 20 Jan 2003 19:59:54.0055 (UTC) FILETIME=[7FD17D70:01C2C0BE]

i would think you would have to initialize the bean if you are doing a
field.getName()

-----Original Message-----
From: rajiv ahuja [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 20, 2003 2:58 PM
To: [EMAIL PROTECTED]
Subject: getter doesn't work in scriplet


Hi

I am using getter in jsp but it throws no such method found exception, but
the same property gets displayed when I use <bean:write.. tag.

So

<logic iterate id="field" name="fields" >
<bean:write name="field" property="name"/>
</logic:iterate>

works

but

<logic iterate id="field" name="fields" >
<% String name = field.getName(); %>
</logic:iterate>

doesn't. Any ideas

Thanks
Rajiv








_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to