日期:2014-05-18  浏览次数:20651 次

求助:jsp页面中得不到值
我定义了一个ben,EmployeeBean,里面定义了一个private   String   iD=null;
有三个构造函数,一个为空,一个参数不包含iD,一个参数包含iD
其中有一个静态方法:search

Vector   vcEmployee=new   Vector();
ResultSet   rs=null;
try
{
rs=DBConnection.executeSQL(strSql);
while(rs.next())
{
String   myIDEmployee=(rs.getString( "ID "));
String   myName=rs.getString( "Name ");
String   myAge=rs.getString( "Age ");
String[]   myInteresting=rs.getString( "Interesting ").split( ": ");
String   myBirthday=rs.getString( "Birthday ");
String   myRemark=rs.getString( "Remark ");
String   mySex=rs.getString( "Sex ");
String   myTel=rs.getString( "Tel ");
String   myAddress=rs.getString( "Address ");
String   myCountry=rs.getString( "Country ");

                    vcEmployee.add(new   EmployeeBean(myIDEmployee,myName,myAge,myInteresting,myBirthday,myRemark,mySex, myTel,myAddress,myCountry));
}
return   vcEmployee;
这是主要部分,我通过new   EmployeeBean已经把值传递过去了
我定义了一个标签类其中:
String   strSql= "select   *   from   base_employees ";
Vector   myVector=new   Vector();
myVector=EmployeeBean.search(strSql);
request.setAttribute( "employeeVector ",myVector);
但是在jsp页面中:
${elementValue[iD]}是空值,这是为什莫。其余的都有值。
高手指点下。多谢


------解决方案--------------------
用request.getAttribute( "employeeVector ",myVector);得到值然后后台打印一下,看是否在前台得到属性的值

------解决方案--------------------
LS:
request.getAttribute( "employeeVector ")