This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
And in HFB P.350, the Bean law states that 4) The property name and type are derived from the getters and setters and NOT from a member in the class.
The "bean requires both getter/setter" is apply to the <jsp:setProperty../> but not the EL ?
Joined: Dec 04, 2004
I think the getter/setter not only apply to the setProperty but for the EL also. When using . or  it calls the getter method. In general if no setter , then the property is read-only. If only getter is definde, you can not update the property using setProperty. If there is no getter then there is error while accessing the property using getProperty or EL. for the following declaration, private int var;
it is not neccessary that the getter and setter should be
public int getVar() public void setVar(int)
I can use
public int getVars() public void setVars(int)
But in this case the property name for bean and EL purpose is vars not var, but the method logic can do anything and can return anything (of given type). It is not neccessary to define the variable int var at all.