aspose file tools*
The moose likes Struts and the fly likes problem with html:select property and HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with html:select property and HashMap" Watch "problem with html:select property and HashMap" New topic
Author

problem with html:select property and HashMap

nesto costa
Greenhorn

Joined: Jan 14, 2009
Posts: 4
hi,

i have a languageImpl.java that has a HashMap<String,String> langs where the key is for example "EN" and the value "ENGLISH".
this HashMap is filled with keys and values from a database by this method public void getLangSet().
then, i have a myForm where i do the following:

LanguageImpl l=new LanguageImpl();
l.getLangSet();
request.setAttribute("test",l.getLangs()); where l.getLangs() returns the HashMap<String,String> langs

then in my jsp i have

<html:select property="xxx">
<htmlptions collection="test" property="key" labelProperty="value" />
</html:select>

now my problem is this, no matter what value i put in the property of html:select, i always get the same error:

javax.servlet.jsp.JspException: No getter method available for property xxx for bean under name org.apache.struts.taglib.html.BEAN

i'm having trouble understanding what is this property and what it does...
can anyone help me?

thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

From the <html:select...> docs:

Name of the request parameter that will be included with this submission, set to the specified value.


In a nutshell, it's the name of the parameter that will be submitted, and the name of the ActionForm property that will be filled by the framework.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with html:select property and HashMap