Hi,
I have a select drop down which I want to set to a default selected option, based on
the selected option.
my code is as below. (from the jsp)
<html:select property="currentFullName">
<html:options collection="teacher" property="fullName"/>
</html:select>
My form class is as follows:
TeacherDisplayForm.java:
/** selected fullName */
private String currentFullName = null;
public void reset(ActionMapping mapping, HttpServletRequest request) {
String thisFullName = (String) request.getParameter("fullName");
if ((thisFullName != null) && !(thisFullName.equals(""))) {
String fullName = (String) request.getParameter("fullName");
this.currentFullName = fullName;
}
if (getPage() == 0) {
//
}
/**
* @return
*/
public String getCurrentFullName() {
return currentFullName;
}
/**
* @param string
*/
public void setCurrentFullName(String string) {
currentFullName = string;
}
my question is:
how do i set the variable currentfullName to a appropriate value, pulled out from the
request/session? becuase the setter doesnt take this("request") as an argument
only the reset method has an input argument of 'request"
Thanks much in advance!
---------------------------------
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.