I'm trying to use the set-property tag in the struts-config file. I know I'm being
stupid, but what exactly is it?
It's not finding the property to set.
Okay if I have in my struts-config.xml:
<action name="loanForm" path="/loanAppWizard"
type="com.sssc.shtuff.actions.LoanAppWizardAction" scope="session">
<set-property property="maxNumberOfPages" value="2" />
<forward name="page1" path="/demographics.jsp"></forward>
<forward name="page2" path="/references.jsp"></forward>
<forward name="done" path="/done.jsp"></forward>
</action>
and this in my action class:
public class LoanAppWizardAction extends Action {
blah
/**Read only property from inside this action that indicates what number is
* the last page.
*/
private int maxNumberOfPages = 0;
Lots o' blah
/**
* @return
*/
public int getMaxNumberOfPages() {
return maxNumberOfPages;
}
public void setMaxNumberOfPages(int i) {
maxNumberOfPages = i;
}
}
Then I should end up with maxNumberOfPages set to 2, and not:
The following exception was logged java.lang.NoSuchMethodException: Bean has no
property named maxNumberOfPages
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]