struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "deepank" <deep...@sasken.com>
Subject Re: very frustrating logic:iterate
Date Tue, 24 Sep 2002 15:31:32 GMT
No i changed it
The problem is solved, thanks to an earlier post.
When using a TreeMap we get a key and a value
so this is how it should be

<logic:iterate id="reviewer" name="revFormTeamVO" property="reviewers" >
 <bean:write name="reviewer" property="value.emp_name" />
 <bean:write name="reviewer" property="value.mail_id_v" />
 <bean:write name="reviewer" property="value.role_n" />
</logic:iterate>
THIS WORKS

thanks for ur interest

Deepank


----- Original Message -----
From: "Vilya Harvey" <vilya.harvey@digitalsteps.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Tuesday, September 24, 2002 8:47 PM
Subject: Re: very frustrating logic:iterate


> Based on the bean code you posted earlier, the property name ought to be
> emp_name_v (i.e. what you had, but with '_v' added to the end).
>
> Hope that helps,
> Vil.
> --
> Vilya Harvey, Consultant
> vilya.harvey@digitalsteps.com                 / digital steps /
> (W) +44 (0)1483 469 480
> (M) +44 (0)7816 678 457                 http://www.digitalsteps.com/
>
>
> ----- Original Message -----
> From: "deepank" <deepank@sasken.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Tuesday, September 24, 2002 4:13 PM
> Subject: Re: very frustrating logic:iterate
>
>
> > when i say this in my jsp
> > <logic:iterate id="reviewer" name="revFormTeamVO" >
property="reviewers">
> > the property ="reviewers" actually returns a collection (TreeMap)
> >
> > if i say
> > <logic:iterate id="reviewer" name="revFormTeamVO" >
property="reviewers">
> > <p> hello world! </p>
> > </logic:iterate>
> >
> > the loop prints hello world! twice, which is correct, because the
TreeMap
> > has two beans.
> > So the logic:iterate is working correctly, only the code below gives an
> > error
> >
> > <logic:iterate id="reviewer" name="revFormTeamVO" property="reviewers" >
> >  <bean:write name="reviewer" property="emp_name" />
> >  <bean:write name="reviewer" property="mail_id_v" />
> >  <bean:write name="reviewer" property="role_n" />
> >
> > </logic:iterate>
> >
> > the error is
> > javax.servlet.ServletException: No getter method for property emp_name
of
> > bean reviewer
> >  at
> >
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> > l.java:471)
> >  at org.apache.jsp.ReviewTeam$jsp._jspService(ReviewTeam$jsp.java:988)
> >  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >  at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > va:201)
> >  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.ja
> >
> >
> > THANKS FOR UR TIME
> > Deepank
> >
> >
> > ----- Original Message -----
> > From: "Sri Sankaran" <Sri.Sankaran@sas.com>
> > To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > Sent: Tuesday, September 24, 2002 8:25 PM
> > Subject: FW: very frustrating logic:iterate
> >
> >
> > >
> > > Just read your first message again.  You said
> > >
> > > > reviewFormTeamVO is an object that has TreeMap, which in turn stores
a
> > > beans
> > > >
> > > > in my jsp i do something like this
> > > >
> > > > <logic:iterate id="reviewer" name="revFormTeamVO"
> > > > property="reviewers">
> > >
> > > If I'm not mistaken, the object you iterate over must be Collection or
a
> > Map.  In your case, revFormTeamVO is some object that *has* a Map.
Trying
> > changing your jsp so that you are iterating over the map.  Check out
> > http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate.
> > >
> > > Sri
> > >
> > > -----Original Message-----
> > > From: deepank [mailto:deepank@sasken.com]
> > > Sent: Tuesday, September 24, 2002 10:08 AM
> > > To: Struts Users Mailing List
> > > Subject: Re: very frustrating logic:iterate
> > >
> > >
> > > Here is entire code for the bean that is getting stored in the TreeMap
> > >
> > > package com.sasken.erp.sdlc.db;
> > >
> > > public class Reviewer implements java.io.Serializable
> > > {
> > >  private String sas_emp_flag_c;
> > >  private String mail_id_v;
> > >  private String emp_name_v;
> > >  private String role_n;
> > >  private String technical_per_v;
> > >
> > >  public Reviewer()
> > >  {
> > >   this.sas_emp_flag_c=null;
> > >   this.mail_id_v=null;
> > >   this.emp_name_v=null;
> > >   this.role_n=null;
> > >   this.technical_per_v=null;
> > >  }
> > >
> > >  public void setSas_emp_flag_c(String sas_emp_flag_c)
> > >  {
> > >   this.sas_emp_flag_c = sas_emp_flag_c;
> > >  }
> > >
> > >  public String getSas_emp_flag_c()
> > >  {
> > >   return this.sas_emp_flag_c;
> > >  }
> > >
> > >  public void setMail_id_v(String mail_id_v)
> > >  {
> > >   this.mail_id_v = mail_id_v;
> > >  }
> > >
> > >  public String getMail_id_v()
> > >  {
> > >   return this.mail_id_v;
> > >  }
> > >
> > >  public void setEmp_name_v(String emp_name_v)
> > >  {
> > >   this.emp_name_v = emp_name_v;
> > >  }
> > >
> > >  public String getEmp_name_v()
> > >  {
> > >   return this.emp_name_v;
> > >  }
> > >
> > >  public void setRole_n(String role_n)
> > >  {
> > >   this.role_n = role_n;
> > >  }
> > >
> > >  public String getRole_n()
> > >  {
> > >   return this.role_n;
> > >  }
> > >
> > >  public void setTechnical_per_v(String technical_per_v)
> > >  {
> > >   this.technical_per_v = technical_per_v;
> > >  }
> > >
> > >  public String getTechnical_per_v()
> > >  {
> > >   return this.technical_per_v;
> > >  }
> > > }
> > >
> > > CLEARLY NO METHOD IS OVERLOADED
> > >
> > > STILL WHY THE ERROR AS BEFORE
> > > Please HELP!!!!!!
> > >
> > > Deepank
> > > ----- Original Message -----
> > > From: "Sri Sankaran" <Sri.Sankaran@sas.com>
> > > To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > > Sent: Tuesday, September 24, 2002 7:23 PM
> > > Subject: RE: very frustrating logic:iterate
> > >
> > >
> > > > There was an earlier post where the user reported that his error
> > > disappeared after removing an overloaded setter.
> > > >
> > > > Another angle:  Try providing the 'type' attribute for the
> > > > <logic:iterate>
> > > >
> > > > Sri
> > > >
> > > > -----Original Message-----
> > > > From: deepank [mailto:deepank@sasken.com]
> > > > Sent: Tuesday, September 24, 2002 9:46 AM
> > > > To: struts-user@jakarta.apache.org
> > > > Subject: very frustrating logic:iterate
> > > >
> > > >
> > > > this is the most frustrating experience ever
> > > >
> > > > i am storing an object in request scope like this
> > > >
> > > > request.setAttribute("revFormTeamVO", reviewFormTeamVO);
> > > >
> > > > reviewFormTeamVO is an object that has TreeMap, which in turn stores
a
> > > beans
> > > >
> > > > in my jsp i do something like this
> > > >
> > > > <logic:iterate id="reviewer" name="revFormTeamVO"
> > > > property="reviewers">
> > > <bean:write name="reviewer" property="emp_name_v" />  <bean:write
> > name="reviewer" property="mail_id_v" />  <bean:write name="reviewer"
> > property="role_n" /> </logic:iterate>
> > > >
> > > > but i get the following error
> > > >
> > > >
> > > >  javax.servlet.ServletException: No getter method for property
> > > > emp_name_v
> > > of bean reviewer
> > > > at
> > >
> >
>
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> > > l.java:471)
> > > > at
org.apache.jsp.ReviewTeam$jsp._jspService(ReviewTeam$jsp.java:988)
> > > > at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > at
> > >
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > > va:20
> > > > This is very frustrating as getting methods are defined for the bean
> > > property as
> > > >
> > > > private String emp_name_v;
> > > >
> > > > public void setEmp_name_v(String emp_name_v)
> > > >  {
> > > >   this.emp_name_v = emp_name_v;
> > > >  }
> > > >
> > > >  public String getEmp_name_v()
> > > >  {
> > > >   return this.emp_name_v;
> > > >  }
> > > >
> > > > STILL I GET AN ERROR:
> > > >
> > > > somebody please point the problem here
> > > >
> > > > Deepank
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > <mailto:struts-user-help@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message