File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes No getter method for property givenqty of bean givenvalform Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No getter method for property givenqty of bean givenvalform" Watch "No getter method for property givenqty of bean givenvalform" New topic

No getter method for property givenqty of bean givenvalform

Praveen palukuri
Ranch Hand

Joined: Feb 10, 2005
Posts: 65
i'm new to struts, i have the following problem when runniny my small appl
"No getter method for property givenqty of bean givenvalform"
it seems everything is correct to me, but i don't know where the problem.
the code follows:

"GivenValForm Bean"
public class GivenValForm {

protected String givenqty;

public void setGivenqty(String givenqty) {
this.givenqty = givenqty;
public String getGivenqty() {
return this.givenqty;

//Action class
GivenValForm givenvalform = null;
System.out.println("In execute method of selected item action");
// creating string array to hold checked items id
String[] selectedlist =((SelectedItemForm)form).getCheckeditem();
int checklength = selectedlist.length ;
//creating an array to hold orders given by user
String[] orderedval = new String[checklength];
//creating an array to hold all order values(includes which r not selected to)
String[] orderedqty = ((SelectedItemForm)form).getOrderedqty();
String val = "";

for(int i=0; i < checklength; i++)
String num = selectedlist[i];
val = orderedqty[(Integer.parseInt(num)-1)];
int oq = Integer.parseInt(val);

orderedval[i] = val ;
//creating an GivenValForm object
givenvalform = new GivenValForm();
//setting the given order to bean object
//storing the given order in the array list.

System.out.println("given quantities:"+ orderedquantity);

it store the values in arraylist & displaying.
but when displaying in browser it throws the exception.
the jsp page as follows:

<logic:iterate id="givenvalform" name="orderedquantity">
<bean:write name="givenvalform" property="givenqty" />

pls send the solution for's urgent to me.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't see any code in your action class that places the ActionForm into the request. You need a statement like:
request.setAttribute("givenvalForm", givenvalForm);

That alone will not fix the problem, though. Check your struts-config.xml to see that you have defined givenvalForm as a form name, and that your action is configured to use givenvalForm.

If you don't know if your configuration is correct or not, show the relevant portions in your next post, and we'll help you with it.

It would also be helpful to see the <html:form> tag in your jsp.
[ March 14, 2005: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Your Action class's posted code does not show the declaration for orderedquantity, but by your call of orderedquantity.add(val); I assume that it is a Collection of Strings (val is a String).

So in your jsp, the givenvalform you are referencing is not a form at all but is a String object, and String does not have a getGivenqty() method!

A good workman is known by his tools.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: No getter method for property givenqty of bean givenvalform
It's not a secret anymore!