aspose file tools*
The moose likes Struts and the fly likes New to struts, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "New to struts, please help" Watch "New to struts, please help" New topic
Author

New to struts, please help

san geetha
Ranch Hand

Joined: Sep 07, 2004
Posts: 44
Iam totally new to struts,
I have a jsp named Trial.jsp which has tag
<html:select property = 'selName' name="TrialFormBean">
<html ptions .....>
</html:select>
Also have a formBean by name TrialFormBean which contains the following code,
private String selName;
...
...
public String getName()
{
return strName;
}

public void setName(String Name)
{
strName = Name;
}
In struts-config.xml have included TrialFormBean as

<form-beans>
<form-bean name="TrialFormBean"
type="formBeans.TrialFormBean"/>
</form-beans>

<action-mappings>
<action
path="/Trial"
type="actions.TrialAction"
name="TrialFormBean">
</action>
</action-mappings>

But i get the following error message:
No getter method available for property selName for bean under name TrialFormBean

What could be my mistake.
san geetha
Ranch Hand

Joined: Sep 07, 2004
Posts: 44
Kindly excuse for being so ignorant.
solved the issue myself.
Today is day 2 of struts learning.

Can anyone let me knw the difference between property attribute and labelproperty attribute in <options> tag present in HTML taglib.

Thanks in advance.
Regards,
Sangeetha
Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
The property attribute is what gets passed to the Action class when u submit your form. It is the value of ur current option selection, whereas the labelProperty attribute is what is displayed as the option text.
Tinku Narang
Greenhorn

Joined: Oct 06, 2004
Posts: 5
hi geetha

U have written the property in select as selName so ue formabean should contain setter and getter for this name i.e. setSelName and getSelName be sure that u have 'S' capital in both the cases that is required than only ur value will be set in the formbean otherwise not.

Try this if solved do tell me , and if not then also

Best Regard
Pankaj Narang
siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
Hi Geetha,

form bean should contain the accessor methods form fields.

i.e setXXX(..)
getXXX()

methods
Bikramjit Debnath
Greenhorn

Joined: Dec 06, 2004
Posts: 2
Originally posted by san geetha:
Iam totally new to struts,
I have a jsp named Trial.jsp which has tag
<html:select property = 'selName' name="TrialFormBean">
<html ptions .....>
</html:select>
Also have a formBean by name TrialFormBean which contains the following code,
private String selName;
...
...
public String getName()
{
return strName;
}

public void setName(String Name)
{
strName = Name;
}
In struts-config.xml have included TrialFormBean as

<form-beans>
<form-bean name="TrialFormBean"
type="formBeans.TrialFormBean"/>
</form-beans>

<action-mappings>
<action
path="/Trial"
type="actions.TrialAction"
name="TrialFormBean">
</action>
</action-mappings>

But i get the following error message:
No getter method available for property selName for bean under name TrialFormBean

What could be my mistake.
Bikramjit Debnath
Greenhorn

Joined: Dec 06, 2004
Posts: 2
You should have a field (veriable, not function) called "selName" in your bean, and a getter method for it(getselName() , and that's all...your code should give no error next time you rebield it !

After all your code says that you want to see a property selName in the "select" options...(combobox) fetching it from the bean.
 
 
subject: New to struts, please help