views:

779

answers:

1

I'm pretty new at this so take it easy on me.

The code I'm trying to get to work is:

<jsp:useBean id="EJD" class= "MoverDetailForm" scope="application"/>
<jsp:setProperty name="EJD" property="empFDJoiningDate" param="empFDJoiningDate" />

<% String empFDJoiningDate = EJD.getEmpFDJoiningDate();
out.print("please work" + empFDJoiningDate); %>

empFDJoiningDate is returning 'null' so i assume it cant find the MoverDetailFom.java?

This does exist

public class MoverDetailForm extends AbstractCandidateForm {

private String empFDJoiningDate;

/**
 * @return Returns the empFDJoiningDate.
 */
public String getEmpFDJoiningDate() {
    return empFDJoiningDate;
}
/**
 * @param empName The empName to set.
 */
public void setEmpFDJoiningDate(String empFDJoiningDate) {
    this.empFDJoiningDate = empFDJoiningDate;
}

Any suggestions would be much appreciated. I'm stuck!

Thanks

+1  A: 

It looks as if you are not setting a value to the empFDJoiningDate property. The param attribute will attempt to set the property on the bean to a request parameter. Do you have a form with a field named empFDJoiningDate which submits to this page?

You should test with a static value like this:

<jsp:useBean id="EJD" class= "MoverDetailForm" scope="application"/>
<jsp:setProperty name="EJD" property="empFDJoiningDate" value="My Static Value" />

If My Static Value prints out then the problem is the parameter. You can test the parameter quite easily with a query string on the url. Lets suppose that your jsp page was named mypage.jsp. Then construct a url like this: mypage.jsp?empFDJoiningDate=TestThis and use this url to request your page in the browser.

Vincent Ramdhanie