Hi 
I have a form bean which extexnds Action form . 
FooForm

This FooForm has an array of another java bean say FooJavaBean


Public class FooForm extends ActionForm {

Public FooJavaBean[] fooBean = ;

Public FooJavaBean getFooBean(int index)
{
        return fooBean[index];
}

Public FooJavaBean[] getFooBean()
{
        return fooBean;
}

Public void setFooBean(int index, FooJavaBean fb)
{
        this.fooBean[index] = fb;
}

Public void setFooBean(FooJavaBean[] fb)
{
        this.fooBean = fb;
}

}

public class FooJavaBean {
        
        public String attID;

        
        public String getAttID()
        {
                return attID;
        }

        public void setAttID(String id)
        {
                this.attID = id;
        }

}

I have to iterate over the FooJavaBean array and display the attID for
each FooJavaBean in the array.

In my JSP I have coded the following
<logic:iterate id="element" name="FooForm" property="fooBean"
indexId="index">
<li><em><bean:write name="element" property='<%= "fooBean[" + index +
"].attID" %>'/></em>&nbsp;[<bean:write name="index"/>]</li>
</logic:iterate>

When I run the JSP I get the following error
Error 500: No getter method for property fooBean[0].attID of bean
element 

Can someone please help me out what I am doing wrong. I started learning
struts only a week ego. So I might be doing some silly mistake. I will
be very thankful if one of you can figure what I am doing wrong.

Thank you in advance
Sandhya




 -----Original Message-----
From: None None [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 13, 2004 12:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Language resource bundles problem


That seems right to me... I added the <message-resource) tags as you
state 
(I already had the config init param in web.xml), but it still doesn't
seem 
to be working, looks like it's still getting null.


>From: "Harjot Narula" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: Language resource bundles problem
>Date: Thu, 13 May 2004 21:05:31 +0530
>
>Hi
>
>I think you need to mention something like this in web.xml
>
>   <init-param>
>    <param-name>config</param-name>
>    <param-value>/WEB-INF/struts-config.xml</param-value>
>   </init-param>
>
>and in struts-config.xml  you need to have this
>
>   <message-resources parameter="ofmResources"/>
>   <message-resources key="de" parameter="ofmResources_de"/>
>
>you can use this in JSP as
>
><bean:message bundle="de" key="messages.deleteFailed" />
>
>This will also work probably
>
>myActionForm.setMessage(mr.getMessage("de", "messages.deleteFailed"));
>
>Correct me if I am wrong
>
>Harjot
>
>
>
>
>
>----- Original Message -----
>From: "None None" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, May 13, 2004 8:54 PM
>Subject: Language resource bundles problem
>
>
> > Hello all.  I posted this question a little while ago as a reply to
>another
> > thread, but I figured the question might be lost there...
> >
> > I'm trying to get multiple language support to work.  I have created
two
> > files, ofmResources.properties and ofmResources_de.properties and
stored
> > them in WEB-INF/classes.
> >
> > In web.xml I have:
> >
> > ...
> > <init-param>
> >   <param-name>application</param-name>
> >   <param-value>ofmResources</param-value>
> > </init-param>
> > ...
> >
> > ...as an init parameter of ActionServlet.  Then, in a particular
action 
>I
> > need to return a message to the view, so I do this:
> >
> > MessageResources mr = getResources(request);
> > myActionForm.setMessage(mr.getMessage("messages.deleteFailed"));
> >
> > Now, this works just fine.  My message is displayed as a result of
the
> > onLoad event of my page via a simple JavaScript alert box.  Very
cool.
> >
> > However, if I want to display the message from the German resource
file, 
>I
> > can't get it to work.  I thought all I had to do was this:
> >
> > myActionForm.setMessage(mr.getMessage("de",
"messages.deleteFailed"));
> >
> > ...but it always seems to return null.  I am expecting that the 
>framework
> > will, in simplest terms, just append _de to the "ofmResources" value
of
>the
> > application init param, and therefore get the messages.deleteFailed 
>value
> > out of that file rather than the default ofmResources.properties
file.
> >
> > Am I nuts or should it not work that way?  If I'm nuts (or nutier
than
> > normal :) ), then how does one get this to work?  If I'm not nuts,
any
>ideas
> > why what I'm doing doesn't work?  Thanks all!
> >
> > _________________________________________________________________
> > Best Restaurant Giveaway Ever! Vote for your favorites for a chance
to 
>win
> > $1 million! http://local.msn.com/special/giveaway.asp
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from
McAfee(r) 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


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

Reply via email to