Yes, I have.
Here's the code:
...
<form-bean name="selectPPForm"
type="forms.SelectPPForm"/>
....
....
<action path="/selectPP"
type="actions.SelectPPAction"
name="selectPPForm"
scope="request">
<forward name="selected" path="/select.jsp"/>
</action>
<action path="/initSelect"
type="actions.InitSelectAction"
name="selectPPForm"
scope="request">
<forward name="init" path="/select.jsp"/>
</action>
....
But it acutally doesn't work...
Thanx for your help bjoern
-----Urspr�ngliche Nachricht-----
Von: Hogan, John [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 1. Mai 2002 17:32
An: 'Struts Users Mailing List'
Betreff: RE: Need help, by using select tag correctly
Do you have an appropriate form class declaration and an associated
action class mapping in your struts-config.xml?
-----Original Message-----
From: Bj�rn Blum [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 8:23 AM
To: Struts Users Mailing List
Subject: Re: Need help, by using select tag correctly
Hello,
<The PlaningPeriodHelper class needs to be an attribute of your
ActionForm <class. The jsp then uses this form bean.
no, it doesn't work. The same error comes up. I added the attribute
PlanningPeriodHelper with getter- and setter Method in the ActionForm
which is associated with the selectPP.do Action, but it doesn#t work.
Bjoern
-----Original Message-----
From: Bj�rn Blum [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 7:21 AM
To: Struts Users Mailing List
Subject: Need help, by using select tag correctly
Hello,
I've got a "little" Problem in how using the struts select - tag
correctly. I'm new to Struts and have read the mails correspondig to the
select-tag in this mailing-list, but i'm not able to run my select tag.
Scenario:
In my action class a list of planningperiods is generated. the select -
tag in the following jsp should be filled with the ids of these periods.
I wrote an helper class containing only three attributes
(planninperiodid, begindate, enddate), with the correct
getter-/setter-Methods.....
here is the code of the helper class, action class, the jsp containing
the select tag and the error code:
<-------------- helper class code ---------------------> package
actions.helper;
....
public class PlanningPeriodHelper extends PlanningPeriod {
private String planningperiodid;
private String begindate;
private String enddate;
public PlanningPeriodHelper() {
}
public PlanningPeriodHelper(String ppid, String begindate, String
enddate)
{
this.planningperiodid = ppid;
this.begindate = begindate;
this.enddate = enddate;
}
public void setPlanningperiodid(String ppid)
{
this.planningperiodid = ppid;
}
public void setBegindate(String bd)
{
this.begindate = bd;
}
public void setEeginddate(String ed)
{
this.enddate = ed;
}
public String getPlanningperiodid()
{
return super.getPlanningPeriodID();
}
public String getBegindate()
{
return begindate;
}
public String getEnddate()
{
return enddate;
}
public static List getAllPlanningperiods()
{
Iterator _pps = PlanningPeriod.getPlanningPeriods().iterator();
List _pplist = new ArrayList();
while (_pps.hasNext())
{
PlanningPeriod next = (PlanningPeriod)_pps.next();
_pplist.add(new PlanningPeriodHelper(next.getPlanningPeriodID(),
new
Long(next.getBeginDate()).toString(),
new
Long(next.getEndDate()).toString()));
}
return _pplist;
}
}
<-------------- end ---------------------------------->
<-------------- action class ------------------------->
public class InitSelectAction extends Action {
public ActionForward perform (ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws
IOException, ServletException {
List _pplist = PlanningPeriodHelper.getAllPlanningperiods();
request.setAttribute("pplist",_pplist);
request.setAttribute("begindate", new Long(1234).toString());
request.setAttribute("enddate", new Long(1235).toString());
return mapping.findForward("init");
}
}
<-------------- end ---------------------------------->
<-------------- jsp ---------------------------------->
<body bgcolor="#FFFFFF" text="#000000">
<html:form action="selectPP.do">
<table width="400" border="1">
<tr>
<td>
<html:select property="planningperiodid">
<html:options collection="pplist" property="planningperiodid"
labelProperty="planningperiodid"/>
</html:select>
</td>
</tr>
<tr>
<td>
<% out.print("Begin Date = " + request.getAttribute("begindate"));%>
</td>
</tr>
<tr>
<td>
<% out.print("End Date = " + request.getAttribute("enddate"));%>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</html:form>
</body>
</html:html>
<-------------- end ---------------------------------->
<-------------- error code --------------------------->
javax.servlet.ServletException: No getter method available for property
planningperiodid for bean under name org.apache.struts.taglib.html.BEAN
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImp
l.java:452)
at
org.apache.jsp._0002fselect_jsp._jspService(_0002fselect_jsp.java:218)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
..............
root cause
javax.servlet.jsp.JspException: No getter method available for property
planningperiodid for bean under name org.apache.struts.taglib.html.BEAN
at
org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:304)
at
org.apache.jsp._0002fselect_jsp._jspService(_0002fselect_jsp.java:115)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
..............
<-------------- end ---------------------------------->
I hope you can help me. I'm at my wit's end.
many,many thanx
bjoern
--
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]>
--
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]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>