tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Baynes" <kbay...@seagullsw.com>
Subject RE: [OFF-Topic]getAttribute and setAttribute
Date Fri, 02 May 2003 15:08:56 GMT

If the attribute 'messageVector' was not set by servlet, you should get
'null' from the request.getAttribute() call. I think if it returned 'null'
you would get ClassCastException at (Vector)request.getAtt(), or
NullPointerException at messageVector.elements().

If neither of these events are happening, then I would guess you are passing
an empty vector into request.setAttribute() on the servlet end. Check that
vector is being built as you expect.

~akb

| -----Original Message-----
| From: Srinivasu Gandu [mailto:SGandu@SoftwareSpecialists.com]
| Sent: Thursday, May 01, 2003 6:27 PM
| To: 'Tomcat Users List'
| Subject: [OFF-Topic]getAttribute and setAttribute
|
|
| I am not getting the values to the jsp page from the servlet when I use
| request.setAttribute("messageVector",messageVector) in the servlet.
|
| In the jsp page I am using the getAttribute to get that vector
| and show them
| in a table row.. I am just getting empty jsp with images but not
| the values
| from the while loop..
| what could be the wrong???
| <%
| 		Vector messageVector =
| (Vector)request.getAttribute("messageVector");
| %>
| <%
| 		String str= "";
|                         Enumeration message = messageVector.elements();
|                         while(message .hasMoreElements()){
|                             str = (String)message.nextElement();
| %>
| 			// I am generating some table rows
| <%
| 		}
| %>
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message