I have read JSP recently, and have a doubt in the javabeans technolgy it uses. Lets say that the following JavaBeans code :
package mortgage;
public class Mortgage
{
private double amount = -1.0;
public void setAmount(double amount)
{
this.amount = amount;
}
}
And lets say i have to make use of this JavaBeans in my JSP and take the parameter values obtain from the HTML form or from the URL query string and JSP code as follows:
<jsp:useBean id="calc" class="mortgage.Mortgage" />
<p> Testing . . .
<c:set target="${calc}" property="amount" value="${param.mortgageAmount}" />
. . . . .
This example was little modified from my book. My question is what does this value in the above code JSP does? Where does the mortgageAmount came from?(is this the value from the HTML form element?)
And also what does target and property does?
Since I am a novice, i dont know what actually is going on the above code. Please help me and correct me if am wrong?
valuerepresents expression that would be set to thetargetit assumed to be coming as param as you have used it in your code by
param.mortgageAmountin url likeIn Simlper words
value is and Expression to be evaluated which will be set to
targetobject’s property represented bypropertySee Also