casePapers must be null?
sd9 wrote:
Hi,
This problem has been driving me mad!
I have this code (below), which isn't going beyond the "casePapers.add(cp)"
line.
It displays the string "------------------before4------------------"
But doesn't display this string "------------------after------------------"
The CasePaper class has been defined already, with all setter functions with
correct spellings etc.
Why doesn't the add() function work?
The code:
private String loginId;
private String password;
private String typeOfUser;
private ArrayList<CasePaper> casePapers;
public String execute() {
UserManager um=new UserManager();
loginId=(String)getSession().get(AwepConstants.LOGINID);
typeOfUser=(String)getSession().get(AwepConstants.TYPEOFUSER);
System.out.println("------------------we are
here------------------"+typeOfUser+"------------");
System.out.println("------------------we are
here------------------"+loginId+"----------");
System.out.println("------------------we are
here------------------");
if (typeOfUser.equals("doctor") ||
typeOfUser.equals("specialist") ||
typeOfUser.equals("patient"))
{
System.out.println("------------------before------------------" );
CasePaper cp=new CasePaper();
cp.setCasePaperID("yaa");
cp.setPatientID("yaa");
cp.setPID("yaa");
cp.setDoctorID("yaa");
cp.setTimeReceived("yaa");
cp.setTimeViewed("yaa");
cp.setForwardedToSpec("yaa");
cp.setTimeViewedBySpec("yaa");
cp.setAppointmentTime("yaa");
cp.setUploadedFileID("yaa");
cp.setQuerySolved("yaa");
cp.setQuery("yaa");
cp.setFeePaid("yaa");
cp.setFirstName("yaa");
cp.setLastName("yaa");
cp.setAddress("yaa");
cp.setCity("yaa");
cp.setCountry("yaa");
cp.setGender("yaa");
cp.setDateOfBirth("yaa");
cp.setBloodGroup("yaa");
cp.setWeight("yaa");
cp.setDeptID("yaa");
cp.setFeeRate("yaa");
cp.setRevenue("yaa");
System.out.println("------------------before4------------------" );
casePapers.add(cp);//it doesn't go beyond this point
System.out.println("------------------after------------------");
//if (casePaper!=null) {return typeOfUser;} else
{return INPUT;}
return typeOfUser;
}
return INPUT;
}//execute
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]