This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

No getter property ....

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I'm getting an error message as follows -
[No getter method available for property strListType for bean under name
org.apache.struts.taglib.html.BEAN]: javax.servlet.jsp.JspException: No getter method
available for property strListType for bean under name org.apache.struts.taglib.html.BEAN
at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:305)

This seems to be happening in a <html:select tag > in my jsp: The code in the jsp is as follows ::
<html:form action="/genPriceListDtls">
<html:select property="strListType" style="width: 145px" onchange="fnShowLevel()">
<html ption value="-"><%=UIConstants.SELECT_LIST_TYPE %></html ption>
<html ptions collection="PriceListTypes" property="key" labelProperty="value" />
</html:select>
....
....
</html:form>
My struts-config.xml file has the following declarations
<form-beans>

<form-bean name="AddPriceListForm" type="actionforms.AddPriceListForm"></form-bean>
</form-beans>
...
...
<action path="/CreateNewPriceList" type="actions.NewPriceList"
name="AddPriceListForm"
scope="request"
validate="false" >
<forward name="success" path="/pricelist/RV2_AddPriceListHeader.jsp" ></forward>
</action>
...
...
My form bean has the getter method for the same String strListType (I've checked it a dozen times!!)
What is the problem here? Is it something special with the :select tag? Am I missing something?
Please help.
regards,
Sam.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam,
Is your getter in the AddPriceListForm bean cased correctly?
Should have a capital "S":
getStrListType()
--
Josh
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I experienced a similar proble. The cause appears to be the case givent to your select tag under its propert name, hence in your .jsp file
<html:select property="mySelect"> is O.K. whereas
<html:select property="MySelect"> is NOT. Presumably, the struts Form class uses introspection and BeanInfo and expects the getter to be

public String[] getMySelect() {
return mySelect;
}

a capitalised MySelect seems to throw this off kilter.

Good Luck,

Simon
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:form action="/genPriceListDtls">
<action path="/CreateNewPriceList" ...

There's your problem.
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic