You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Galbreath, Mark" <Ga...@tessco.com> on 2002/05/24 18:34:48 UTC
RE: Pb : request.SetAttribute() from Action
First, don't type proj as an ArrayList; it should be a List.
Second, if what is happening is as you say, proj == null. Check what you
are putting into it.
Mark
-----Original Message-----
From: Damien VIEL [mailto:damien@studioclick.fr]
Sent: Friday, May 24, 2002 12:25 PM
Hi,
I've many problem to put a ArrayList from my Action in the request.
----------------------------------------------------------------------------
-----------
By doing for example in my Action Class :
ArrayList proj = new ArrayList();
proj.add(new LabelValueBean("name", "id"));
request.setAttribute("projects", proj);
return (mapping.findForward("success"));
----------------------------------------------------------------------------
-----------
In my JSP if I try this :
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<logic:present name="projects" scope="request">
<logic:iterate name="projects" id="proj" scope="request"
type="LabelValueBean">
<bean:write name="proj" property="label"/>
<bean:write name="proj" property="value"/>
</logic:iterate>
</logic:present>
<logic:notPresent name="projects" scope="request">
Error
</logic:notPresent>
---------------------------------------------------------------------------
------------
I have allays the "notPresent" message
I can not fint the solution !!
Deos it comes from the Struts-config.xml, form the fact that i'm use the
Template TagLib ??
Please Help
Thanks All
Dams
Dams
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Pb : request.SetAttribute() from Action
Posted by Damien VIEL <da...@studioclick.fr>.
Hi,
I really think that my pb comes from the fact that
i'm doing request.setAttribute("myarray", arraylist) in the Action class.
In the JSP, I still have the notPresent body message from the Logic TagLib.
I've no idea where is the mistake ????
Thanks
Dams
----- Original Message -----
From: "Damien VIEL" <da...@studioclick.fr>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 9:58 PM
Subject: Re: Pb : request.SetAttribute() from Action
> Yes I did,
> following my JSP :
> <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
>
> <logic:present name="projlist" scope="request">
> <logic:iterate name="projlist" id="proj" scope="request"
> type="java.util.ArrayList">
> <bean:write name="projlist" property="label"/>
> <br>
> </logic:iterate>
> </logic:present>
>
> <logic:notPresent name="projlist" scope="request">
> Error
> </logic:notPresent>
>
> I still have my bug.....
> Thanks
> Dams
>
>
> ----- Original Message -----
> From: "Rajesh Kalluri" <rk...@manduca.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Friday, May 24, 2002 7:17 PM
> Subject: RE: Pb : request.SetAttribute() from Action
>
>
> > Damien,
> >
> > Did you import the struts tags, if not the tags cannot be interpreted
and
> > you will have the message from "Error" from logic not present will
always
> > be printed.
> >
> > Regards
> > Raj
> >
> > -----Original Message-----
> > From: Damien VIEL [mailto:damien@studioclick.fr]
> > Sent: Friday, May 24, 2002 12:56 PM
> > To: Struts Users Mailing List
> > Subject: Re: Pb : request.SetAttribute() from Action
> >
> >
> > Hi,
> > With the List I have the following error:
> > java.lang.NullPointerException at
> action.MyAction.perform(MyAction.java:50)
> >
> > Thanks
> >
> > Dams
> >
> > ----- Original Message -----
> > From: "Galbreath, Mark" <Ga...@tessco.com>
> > To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> > Sent: Friday, May 24, 2002 6:34 PM
> > Subject: RE: Pb : request.SetAttribute() from Action
> >
> >
> > > First, don't type proj as an ArrayList; it should be a List.
> > >
> > > Second, if what is happening is as you say, proj == null. Check what
> you
> > > are putting into it.
> > >
> > > Mark
> > >
> > > -----Original Message-----
> > > From: Damien VIEL [mailto:damien@studioclick.fr]
> > > Sent: Friday, May 24, 2002 12:25 PM
> > >
> > > Hi,
> > > I've many problem to put a ArrayList from my Action in the request.
> >
>
> --------------------------------------------------------------------------
> > --
> > > -----------
> > > By doing for example in my Action Class :
> > > ArrayList proj = new ArrayList();
> > > proj.add(new LabelValueBean("name", "id"));
> > > request.setAttribute("projects", proj);
> > > return (mapping.findForward("success"));
> >
>
> --------------------------------------------------------------------------
> > --
> > > -----------
> > > In my JSP if I try this :
> > > <%@ page language="java" %>
> > > <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> > > <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> > > <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> > > <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
> > >
> > > <logic:present name="projects" scope="request">
> > > <logic:iterate name="projects" id="proj" scope="request"
> > > type="LabelValueBean">
> > > <bean:write name="proj" property="label"/>
> > > <bean:write name="proj" property="value"/>
> > > </logic:iterate>
> > > </logic:present>
> > >
> > > <logic:notPresent name="projects" scope="request">
> > > Error
> > > </logic:notPresent>
> >
> ------------------------------------------------------------------------
-
> > --
> > > ------------
> > > I have allays the "notPresent" message
> > >
> > > I can not fint the solution !!
> > > Deos it comes from the Struts-config.xml, form the fact that i'm use
the
> > > Template TagLib ??
> > >
> > > Please Help
> > > Thanks All
> > >
> > > Dams
> > > Dams
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pb : request.SetAttribute() from Action
Posted by Rajesh Kalluri <rk...@manduca.com>.
<logic:iterate name="projlist" id="proj" scope="request"
type="java.util.ArrayList">
<bean:write name="projlist" property="label"/>
<br>
</logic:iterate>
when you give id as "proj", you should be using that in ur bean:write
instead of "projlist".
<logic:iterate name="projlist" id="proj" scope="request"
type="java.util.ArrayList">
<bean:write name="proj" property="label"/>
<br>
</logic:iterate>
Raj
-----Original Message-----
From: Damien VIEL [mailto:damien@studioclick.fr]
Sent: Friday, May 24, 2002 3:58 PM
To: Struts Users Mailing List
Subject: Re: Pb : request.SetAttribute() from Action
Yes I did,
following my JSP :
<%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<logic:present name="projlist" scope="request">
<logic:iterate name="projlist" id="proj" scope="request"
type="java.util.ArrayList">
<bean:write name="projlist" property="label"/>
<br>
</logic:iterate>
</logic:present>
<logic:notPresent name="projlist" scope="request">
Error
</logic:notPresent>
I still have my bug.....
Thanks
Dams
----- Original Message -----
From: "Rajesh Kalluri" <rk...@manduca.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 7:17 PM
Subject: RE: Pb : request.SetAttribute() from Action
> Damien,
>
> Did you import the struts tags, if not the tags cannot be interpreted and
> you will have the message from "Error" from logic not present will always
> be printed.
>
> Regards
> Raj
>
> -----Original Message-----
> From: Damien VIEL [mailto:damien@studioclick.fr]
> Sent: Friday, May 24, 2002 12:56 PM
> To: Struts Users Mailing List
> Subject: Re: Pb : request.SetAttribute() from Action
>
>
> Hi,
> With the List I have the following error:
> java.lang.NullPointerException at
action.MyAction.perform(MyAction.java:50)
>
> Thanks
>
> Dams
>
> ----- Original Message -----
> From: "Galbreath, Mark" <Ga...@tessco.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Friday, May 24, 2002 6:34 PM
> Subject: RE: Pb : request.SetAttribute() from Action
>
>
> > First, don't type proj as an ArrayList; it should be a List.
> >
> > Second, if what is happening is as you say, proj == null. Check what
you
> > are putting into it.
> >
> > Mark
> >
> > -----Original Message-----
> > From: Damien VIEL [mailto:damien@studioclick.fr]
> > Sent: Friday, May 24, 2002 12:25 PM
> >
> > Hi,
> > I've many problem to put a ArrayList from my Action in the request.
>
> --------------------------------------------------------------------------
> --
> > -----------
> > By doing for example in my Action Class :
> > ArrayList proj = new ArrayList();
> > proj.add(new LabelValueBean("name", "id"));
> > request.setAttribute("projects", proj);
> > return (mapping.findForward("success"));
>
> --------------------------------------------------------------------------
> --
> > -----------
> > In my JSP if I try this :
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
> >
> > <logic:present name="projects" scope="request">
> > <logic:iterate name="projects" id="proj" scope="request"
> > type="LabelValueBean">
> > <bean:write name="proj" property="label"/>
> > <bean:write name="proj" property="value"/>
> > </logic:iterate>
> > </logic:present>
> >
> > <logic:notPresent name="projects" scope="request">
> > Error
> > </logic:notPresent>
>
-------------------------------------------------------------------------
> --
> > ------------
> > I have allays the "notPresent" message
> >
> > I can not fint the solution !!
> > Deos it comes from the Struts-config.xml, form the fact that i'm use the
> > Template TagLib ??
> >
> > Please Help
> > Thanks All
> >
> > Dams
> > Dams
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Pb : request.SetAttribute() from Action
Posted by Damien VIEL <da...@studioclick.fr>.
Yes I did,
following my JSP :
<%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<logic:present name="projlist" scope="request">
<logic:iterate name="projlist" id="proj" scope="request"
type="java.util.ArrayList">
<bean:write name="projlist" property="label"/>
<br>
</logic:iterate>
</logic:present>
<logic:notPresent name="projlist" scope="request">
Error
</logic:notPresent>
I still have my bug.....
Thanks
Dams
----- Original Message -----
From: "Rajesh Kalluri" <rk...@manduca.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 7:17 PM
Subject: RE: Pb : request.SetAttribute() from Action
> Damien,
>
> Did you import the struts tags, if not the tags cannot be interpreted and
> you will have the message from "Error" from logic not present will always
> be printed.
>
> Regards
> Raj
>
> -----Original Message-----
> From: Damien VIEL [mailto:damien@studioclick.fr]
> Sent: Friday, May 24, 2002 12:56 PM
> To: Struts Users Mailing List
> Subject: Re: Pb : request.SetAttribute() from Action
>
>
> Hi,
> With the List I have the following error:
> java.lang.NullPointerException at
action.MyAction.perform(MyAction.java:50)
>
> Thanks
>
> Dams
>
> ----- Original Message -----
> From: "Galbreath, Mark" <Ga...@tessco.com>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Friday, May 24, 2002 6:34 PM
> Subject: RE: Pb : request.SetAttribute() from Action
>
>
> > First, don't type proj as an ArrayList; it should be a List.
> >
> > Second, if what is happening is as you say, proj == null. Check what
you
> > are putting into it.
> >
> > Mark
> >
> > -----Original Message-----
> > From: Damien VIEL [mailto:damien@studioclick.fr]
> > Sent: Friday, May 24, 2002 12:25 PM
> >
> > Hi,
> > I've many problem to put a ArrayList from my Action in the request.
>
> --------------------------------------------------------------------------
> --
> > -----------
> > By doing for example in my Action Class :
> > ArrayList proj = new ArrayList();
> > proj.add(new LabelValueBean("name", "id"));
> > request.setAttribute("projects", proj);
> > return (mapping.findForward("success"));
>
> --------------------------------------------------------------------------
> --
> > -----------
> > In my JSP if I try this :
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
> >
> > <logic:present name="projects" scope="request">
> > <logic:iterate name="projects" id="proj" scope="request"
> > type="LabelValueBean">
> > <bean:write name="proj" property="label"/>
> > <bean:write name="proj" property="value"/>
> > </logic:iterate>
> > </logic:present>
> >
> > <logic:notPresent name="projects" scope="request">
> > Error
> > </logic:notPresent>
>
-------------------------------------------------------------------------
> --
> > ------------
> > I have allays the "notPresent" message
> >
> > I can not fint the solution !!
> > Deos it comes from the Struts-config.xml, form the fact that i'm use the
> > Template TagLib ??
> >
> > Please Help
> > Thanks All
> >
> > Dams
> > Dams
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pb : request.SetAttribute() from Action
Posted by Rajesh Kalluri <rk...@manduca.com>.
Damien,
Did you import the struts tags, if not the tags cannot be interpreted and
you will have the message from "Error" from logic not present will always
be printed.
Regards
Raj
-----Original Message-----
From: Damien VIEL [mailto:damien@studioclick.fr]
Sent: Friday, May 24, 2002 12:56 PM
To: Struts Users Mailing List
Subject: Re: Pb : request.SetAttribute() from Action
Hi,
With the List I have the following error:
java.lang.NullPointerException at action.MyAction.perform(MyAction.java:50)
Thanks
Dams
----- Original Message -----
From: "Galbreath, Mark" <Ga...@tessco.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 6:34 PM
Subject: RE: Pb : request.SetAttribute() from Action
> First, don't type proj as an ArrayList; it should be a List.
>
> Second, if what is happening is as you say, proj == null. Check what you
> are putting into it.
>
> Mark
>
> -----Original Message-----
> From: Damien VIEL [mailto:damien@studioclick.fr]
> Sent: Friday, May 24, 2002 12:25 PM
>
> Hi,
> I've many problem to put a ArrayList from my Action in the request.
> --------------------------------------------------------------------------
--
> -----------
> By doing for example in my Action Class :
> ArrayList proj = new ArrayList();
> proj.add(new LabelValueBean("name", "id"));
> request.setAttribute("projects", proj);
> return (mapping.findForward("success"));
> --------------------------------------------------------------------------
--
> -----------
> In my JSP if I try this :
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
>
> <logic:present name="projects" scope="request">
> <logic:iterate name="projects" id="proj" scope="request"
> type="LabelValueBean">
> <bean:write name="proj" property="label"/>
> <bean:write name="proj" property="value"/>
> </logic:iterate>
> </logic:present>
>
> <logic:notPresent name="projects" scope="request">
> Error
> </logic:notPresent>
> -------------------------------------------------------------------------
--
> ------------
> I have allays the "notPresent" message
>
> I can not fint the solution !!
> Deos it comes from the Struts-config.xml, form the fact that i'm use the
> Template TagLib ??
>
> Please Help
> Thanks All
>
> Dams
> Dams
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Pb : request.SetAttribute() from Action
Posted by Damien VIEL <da...@studioclick.fr>.
Hi,
With the List I have the following error:
java.lang.NullPointerException at action.MyAction.perform(MyAction.java:50)
Thanks
Dams
----- Original Message -----
From: "Galbreath, Mark" <Ga...@tessco.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 6:34 PM
Subject: RE: Pb : request.SetAttribute() from Action
> First, don't type proj as an ArrayList; it should be a List.
>
> Second, if what is happening is as you say, proj == null. Check what you
> are putting into it.
>
> Mark
>
> -----Original Message-----
> From: Damien VIEL [mailto:damien@studioclick.fr]
> Sent: Friday, May 24, 2002 12:25 PM
>
> Hi,
> I've many problem to put a ArrayList from my Action in the request.
> --------------------------------------------------------------------------
--
> -----------
> By doing for example in my Action Class :
> ArrayList proj = new ArrayList();
> proj.add(new LabelValueBean("name", "id"));
> request.setAttribute("projects", proj);
> return (mapping.findForward("success"));
> --------------------------------------------------------------------------
--
> -----------
> In my JSP if I try this :
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
>
> <logic:present name="projects" scope="request">
> <logic:iterate name="projects" id="proj" scope="request"
> type="LabelValueBean">
> <bean:write name="proj" property="label"/>
> <bean:write name="proj" property="value"/>
> </logic:iterate>
> </logic:present>
>
> <logic:notPresent name="projects" scope="request">
> Error
> </logic:notPresent>
> -------------------------------------------------------------------------
--
> ------------
> I have allays the "notPresent" message
>
> I can not fint the solution !!
> Deos it comes from the Struts-config.xml, form the fact that i'm use the
> Template TagLib ??
>
> Please Help
> Thanks All
>
> Dams
> Dams
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Pb : request.SetAttribute() from Action
Posted by Damien VIEL <da...@studioclick.fr>.
Ok I'll try with the List
and I have allready tried to print the size
of my ArrayList and it is not empty.
System.out.println("ArrayList size : " + proj.size());
Thanks
Dams
----- Original Message -----
From: "Galbreath, Mark" <Ga...@tessco.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Friday, May 24, 2002 6:34 PM
Subject: RE: Pb : request.SetAttribute() from Action
> First, don't type proj as an ArrayList; it should be a List.
>
> Second, if what is happening is as you say, proj == null. Check what you
> are putting into it.
>
> Mark
>
> -----Original Message-----
> From: Damien VIEL [mailto:damien@studioclick.fr]
> Sent: Friday, May 24, 2002 12:25 PM
>
> Hi,
> I've many problem to put a ArrayList from my Action in the request.
> --------------------------------------------------------------------------
--
> -----------
> By doing for example in my Action Class :
> ArrayList proj = new ArrayList();
> proj.add(new LabelValueBean("name", "id"));
> request.setAttribute("projects", proj);
> return (mapping.findForward("success"));
> --------------------------------------------------------------------------
--
> -----------
> In my JSP if I try this :
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/tld/app.tld" prefix="app" %>
> <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
>
> <logic:present name="projects" scope="request">
> <logic:iterate name="projects" id="proj" scope="request"
> type="LabelValueBean">
> <bean:write name="proj" property="label"/>
> <bean:write name="proj" property="value"/>
> </logic:iterate>
> </logic:present>
>
> <logic:notPresent name="projects" scope="request">
> Error
> </logic:notPresent>
> -------------------------------------------------------------------------
--
> ------------
> I have allays the "notPresent" message
>
> I can not fint the solution !!
> Deos it comes from the Struts-config.xml, form the fact that i'm use the
> Template TagLib ??
>
> Please Help
> Thanks All
>
> Dams
> Dams
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>