You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gaet <ga...@free.fr> on 2005/11/17 15:32:36 UTC
Newbie problem with "Nested" tag library
Hi everybody,
I currently want to display a value with struts's tags instead with "pure"
java.
Here is the code I want to translate :
<%=
((Employe)employesVector.elementAt(i)).getEmploiservice().getEmploi().getLib
ellelong() %>
I have tried to translate with nested library as it seems to be the solution
but with no result.
<nested:iterate id="employee" name="employesVector">
<nested:nest property="emploiservice">
<nested:nest property="emploi">
<nested:write property="libellelong"/>
</nested:nest>
</nested:nest>
</nested:iterate>
Does anybody know the solution? (or have a link on a good tutorial/samples)
Thanks very much for your help
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie problem with "Nested" tag library
Posted by Gaet <ga...@free.fr>.
HI,
I found the solution and it was just missing the <nested:root> element.
Here is the complete stuff :
<nested:iterate id="employe" name="employesVector">
<nested:root name="employe">
<nested:nest property="emploiservice">
<nested:nest property="emploi">
<nested:write property="libellelong"/>
</nested:nest>
</nested:nest>
</nested:root>
</nested:iterate>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie problem with "Nested" tag library
Posted by Gaet <ga...@free.fr>.
With the code :
<nested:iterate id="employee" name="employesVector">
<nested:nest property="emploiservice">
<nested:write property="idemploiservice/>
</nested:nest>
</nested:iterate>
I got the following error in my browser:
" Error 500: No getter method for property null[0].emploiservice.idemploiservice of bean employesVector "
why it retrieves "null[0]"???
TIA
----- Original Message -----
From: Gaet
To: Struts Users Mailing List
Sent: Thursday, November 17, 2005 5:00 PM
Subject: Re: Newbie problem with "Nested" tag library
Thanks Alex but i'd like to use only tags and if possible "Nested" tags....
Why, this works
<nested:iterate id="employee" name="employesVector">
<nested:write name="employee" property="nom"/>
</nested:iterate>
And, this not :
<nested:iterate id="employee" name="employesVector">
<nested:nest property="emploiservice">
<nested:write property="idemploiservice/>
</nested:nest>
</nested:iterate>
I know that I have no attribute "name" in second case, but normally I don't know which I have to put...
Thanks for help!
----- Original Message -----
From: ALEX HYDE
To: Struts Users Mailing List
Sent: Thursday, November 17, 2005 4:23 PM
Subject: Re: Newbie problem with "Nested" tag library
You might try something along the lines of:
<ns:iterate id="employee" name="employesVector">
<ns:out
value=${employee.emploiservice.emploi.libellelong}"/>
</ns:iterate>
Syntax not accurate... :O|
--- Gaet <ga...@free.fr> wrote:
> Hi everybody,
>
> I currently want to display a value with struts's
> tags instead with "pure"
> java.
> Here is the code I want to translate :
>
> <%=
>
((Employe)employesVector.elementAt(i)).getEmploiservice().getEmploi().getLib
> ellelong() %>
>
>
> I have tried to translate with nested library as it
> seems to be the solution
> but with no result.
>
>
> <nested:iterate id="employee" name="employesVector">
> <nested:nest property="emploiservice">
> <nested:nest property="emploi">
> <nested:write
> property="libellelong"/>
> </nested:nest>
> </nested:nest>
> </nested:iterate>
>
> Does anybody know the solution? (or have a link on a
> good tutorial/samples)
>
> Thanks very much for your help
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie problem with "Nested" tag library
Posted by ALEX HYDE <al...@btinternet.com>.
I don't think you're referencing your beans properly.
I've never seen that syntax before :O) but I'm pretty
new to this.
This version does just use tags:
<ns:iterate id="employee" name="employesVector">
<ns:out
value=${employee.emploiservice.emploi.libellelong}"/>
</ns:iterate>
It uses as an 'iterator' tag to loop, and an 'out' tag
to output your value. You nest the out tag inside of
the iterate tag and it will output what you specify in
value. In this case it will output the longname of
each employee. This looks like what you want to do?
Gluck.
--- Gaet <ga...@free.fr> wrote:
> Thanks Alex but i'd like to use only tags and if
> possible "Nested" tags....
>
> Why, this works
>
> <nested:iterate id="employee" name="employesVector">
> <nested:write name="employee"
> property="nom"/>
> </nested:iterate>
>
>
> And, this not :
>
> <nested:iterate id="employee" name="employesVector">
> <nested:nest property="emploiservice">
> <nested:write
> property="idemploiservice/>
> </nested:nest>
> </nested:iterate>
>
> I know that I have no attribute "name" in second
> case, but normally I don't know which I have to
> put...
>
> Thanks for help!
>
>
> ----- Original Message -----
> From: ALEX HYDE
> To: Struts Users Mailing List
> Sent: Thursday, November 17, 2005 4:23 PM
> Subject: Re: Newbie problem with "Nested" tag
> library
>
>
> You might try something along the lines of:
>
> <ns:iterate id="employee" name="employesVector">
> <ns:out
>
>
value=${employee.emploiservice.emploi.libellelong}"/>
> </ns:iterate>
>
> Syntax not accurate... :O|
>
> --- Gaet <ga...@free.fr> wrote:
>
> > Hi everybody,
> >
> > I currently want to display a value with
> struts's
> > tags instead with "pure"
> > java.
> > Here is the code I want to translate :
> >
> > <%=
> >
>
>
((Employe)employesVector.elementAt(i)).getEmploiservice().getEmploi().getLib
> > ellelong() %>
> >
> >
> > I have tried to translate with nested library as
> it
> > seems to be the solution
> > but with no result.
> >
> >
> > <nested:iterate id="employee"
> name="employesVector">
> > <nested:nest property="emploiservice">
> > <nested:nest property="emploi">
> > <nested:write
> > property="libellelong"/>
> > </nested:nest>
> > </nested:nest>
> > </nested:iterate>
> >
> > Does anybody know the solution? (or have a link
> on a
> > good tutorial/samples)
> >
> > Thanks very much for your help
> >
> >
> >
> >
>
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
>
>
>
>
___________________________________________________________
>
> Yahoo! Model Search 2005 - Find the next catwalk
> superstars -
> http://uk.news.yahoo.com/hot/model-search/
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie problem with "Nested" tag library
Posted by Gaet <ga...@free.fr>.
Thanks Alex but i'd like to use only tags and if possible "Nested" tags....
Why, this works
<nested:iterate id="employee" name="employesVector">
<nested:write name="employee" property="nom"/>
</nested:iterate>
And, this not :
<nested:iterate id="employee" name="employesVector">
<nested:nest property="emploiservice">
<nested:write property="idemploiservice/>
</nested:nest>
</nested:iterate>
I know that I have no attribute "name" in second case, but normally I don't know which I have to put...
Thanks for help!
----- Original Message -----
From: ALEX HYDE
To: Struts Users Mailing List
Sent: Thursday, November 17, 2005 4:23 PM
Subject: Re: Newbie problem with "Nested" tag library
You might try something along the lines of:
<ns:iterate id="employee" name="employesVector">
<ns:out
value=${employee.emploiservice.emploi.libellelong}"/>
</ns:iterate>
Syntax not accurate... :O|
--- Gaet <ga...@free.fr> wrote:
> Hi everybody,
>
> I currently want to display a value with struts's
> tags instead with "pure"
> java.
> Here is the code I want to translate :
>
> <%=
>
((Employe)employesVector.elementAt(i)).getEmploiservice().getEmploi().getLib
> ellelong() %>
>
>
> I have tried to translate with nested library as it
> seems to be the solution
> but with no result.
>
>
> <nested:iterate id="employee" name="employesVector">
> <nested:nest property="emploiservice">
> <nested:nest property="emploi">
> <nested:write
> property="libellelong"/>
> </nested:nest>
> </nested:nest>
> </nested:iterate>
>
> Does anybody know the solution? (or have a link on a
> good tutorial/samples)
>
> Thanks very much for your help
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Newbie problem with "Nested" tag library
Posted by ALEX HYDE <al...@btinternet.com>.
You might try something along the lines of:
<ns:iterate id="employee" name="employesVector">
<ns:out
value=${employee.emploiservice.emploi.libellelong}"/>
</ns:iterate>
Syntax not accurate... :O|
--- Gaet <ga...@free.fr> wrote:
> Hi everybody,
>
> I currently want to display a value with struts's
> tags instead with "pure"
> java.
> Here is the code I want to translate :
>
> <%=
>
((Employe)employesVector.elementAt(i)).getEmploiservice().getEmploi().getLib
> ellelong() %>
>
>
> I have tried to translate with nested library as it
> seems to be the solution
> but with no result.
>
>
> <nested:iterate id="employee" name="employesVector">
> <nested:nest property="emploiservice">
> <nested:nest property="emploi">
> <nested:write
> property="libellelong"/>
> </nested:nest>
> </nested:nest>
> </nested:iterate>
>
> Does anybody know the solution? (or have a link on a
> good tutorial/samples)
>
> Thanks very much for your help
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org