Hi I am trying to use struts to get a bean to my jsp code the bean I am using in my jsp page is: <bean:write name="unitForm" property="testData.team.type" /> but whenever I run the jsp I am receiving No getter method for property: "testData.team.type" of bean: "unitForm". I am trying to write baseball to my jsp page.
What struts framework does for us is if you mention it tries to fetch value of testData.team.type from "unitform" type object in the scope mentioned using the getter method. As the error clearly mentions "No getter method" that means your it is considering the whole property as a single one and trying to call something like getTestData.team.type() method. You have two ways to get out of it
1. If you are using only struts and no EL
define the team object and then get the value, example -
2. If you are using struts-el, include the definitions in your view file and do whatever you have already done- do not forget the syntax
Have Fun with Java
little,little.. little by little makes a lot..
Joined: Sep 29, 2012
Hi I tried
inside of the jsp and still received the error:
No getter method for property: "type" of bean: "teamObj"
I overlooked at your post... "team" is just a String and and it is trying to do getType() from your "team" which doesnt exists. You need to simple do Here, since TestGettingData extends Sport it should be able to get the value from parent class.
Hope you are understanding what is happening, Understanding the problem is more important sometimes than solving it just like that