struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Bednarz <>
Subject Problems to fill a DropDownListbox on a DynaValidatorActionForm
Date Sun, 03 Sep 2006 16:45:35 GMT
I try to fill a DropDownListbox on a DynaValidatorActionForm and get the 
following exception:

2006-09-03 18:20:45,007 ERROR [http-8080-1] [/mtweb].[jsp] 
(     - Servlet.service() for servlet jsp 
threw exception
javax.servlet.jsp.JspException: Cannot find bean under name 
	at org.apache.struts.taglib.html.OptionsTag.doEndTag(

I have the follwoing definition in struts-config.xml:

<form-bean name="editExpenseForm" 
   <form-property name="expenseType" type="java.lang.String" />
   <form-property name="expenseName" type="java.lang.String" />
   <form-property name="expenseId" type="java.lang.String" />
   <form-property name="expenseDescription" type="java.lang.String" />
   <form-property name="expenseLocation" type="java.lang.String"/>
   <form-property name="expenseAmount" type="java.lang.String"/>
   <form-property name="expenseIsoCurrency" type="java.lang.String"/>
   <form-property name="expenseReceiptNo" type="java.lang.String"/>
   <form-property name="expenseTime" type="java.lang.String"/>
   <form-property name="expensePaymentMethodID" type="java.lang.String"/>
   <form-property name="expenseCrossrate" type="java.lang.String"/>
   <form-property name="expenseProjectId" type="java.lang.String"/>

expenseType should be the SELECTED item of a drop-down-listbox. I do 
have a business object containing a java.util.Vector of expenseTypes.
In my JSP file I have:

<html:select property="expenseType">
   <html:options collection="${sessionScope.expense.expenseTypes}"
       property="typeCode" labelProperty="typeDescription"/>

I also tried:

<html:select property="expenseType">
   <c:forEach items="${sessionScope.expense.expenseTypes}" var="record">
     <html:optionsCollection label="${record.typeDescription}"
         value="${record.typeCode}" />

but also without any success!

The business object is defined as follows with the containing class 

public class TxpExpense extends trixpertObject

   private Vector expenseTypes = new Vector();
   public synchronized Vector getExpenseTypes()
	return expenseTypes;
   public synchronized void setExpenseTypes(Vector expenseTypes)
	this.expenseTypes = expenseTypes;
   // somewhere is code which retrieves data
   // from a database to fill instances of
   // class ExpenseType into the Vector
   // expenseTypes

   // an inner class as bean for ExpenseTypes
   public class ExpenseType
     long typeCode;
     String typeDescription;

     public ExpenseType()
     public ExpenseType(long typeCode, String typeDescription)
       this.typeCode = typeCode;
       this.typeDescription = typeDescription;

     ... correct getters and setters

What am I doing wrong? Why can the type ExpenseType not be found? Is it 
a problem to define it as inner class?

Many thanks for your help!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message