In my Servlet:
person.setEmail(eMail);
request.getSession().setAttribute("person", person);
RequestDispatcher rd = request.getRequestDispatcher("/JSPAddress");
rd.forward(request, response);
My Bean Class:
private String eMail;
public Person(String eMail) {
setEmail(eMail);
}
public String getEmail() {
return eMail;
}
public void setEmail(String Email) {
this.eMail = Email;
}
In my JSPAddress:
<input type="text" size="45" name="email" value='<c:out value="${person.eMail}" />' >
What I want:
- An email value in textfield, which is set in a Servlet
EL accesses properties by getters, not directly by the field. If your setter is named
setEmail()then your getter is likely namedgetEmail(), so the property name is reallyemail, noteMail.Thus, this should do