Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

error: No getter method for property

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

the code for my action form is:



testing data class has:


and finally in my sport class:




 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,
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
 
Dave Jamz
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I tried



inside of the jsp and still received the error:

No getter method for property: "type" of bean: "teamObj"

I also tried



and got:

javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property: "" of bean: "unitForm"
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Dave,
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

 
Seriously? That's what you're going with? I prefer this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!