wood burning stoves
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with html:select property and HashMap" Watch "problem with html:select property and HashMap" New topic

problem with html:select property and HashMap

nesto costa

Joined: Jan 14, 2009
Posts: 4

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();
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" />

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?

David Newton

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.
It is sorta covered in the JavaRanch Style Guide.
subject: problem with html:select property and HashMap
It's not a secret anymore!