From tomcat-user-return-62735-qmlist-jakarta-archive-tomcat-user=nagoya.apache.org@jakarta.apache.org Fri May 02 20:28:21 2003 Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 70841 invoked from network); 2 May 2003 20:28:20 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 2 May 2003 20:28:20 -0000 Received: (qmail 15259 invoked by uid 97); 2 May 2003 20:30:26 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 15247 invoked from network); 2 May 2003 20:30:26 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 2 May 2003 20:30:26 -0000 Received: (qmail 69334 invoked by uid 500); 2 May 2003 20:28:05 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 69323 invoked from network); 2 May 2003 20:28:05 -0000 Received: from mail.softwarespecialists.com (HELO shillong.SoftwareSpecialists.com) (209.195.150.115) by daedalus.apache.org with SMTP; 2 May 2003 20:28:05 -0000 Received: by SHILLONG with Internet Mail Service (5.5.2653.19) id ; Fri, 2 May 2003 16:24:44 -0400 Message-ID: From: Srinivasu Gandu To: 'Tomcat Users List' Subject: RE: [OFF-Topic]getAttribute and setAttribute Date: Fri, 2 May 2003 16:24:43 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi kevin, Is there any package or classes I am missing in sending my vector to jsp page... this is so wiered.. I even able to check my vector is not empty before doing request.setAttribute() for(int i=0; i<10; i++){ System.out.println("element"+i+"= "+messageVector.elementAt(i)); } I am doing import java.io.*; import java.sql.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; Appreciate any help! -----Original Message----- From: Kevin Baynes [mailto:kbaynes@seagullsw.com] Sent: Friday, May 02, 2003 11:09 AM To: Tomcat Users List Subject: RE: [OFF-Topic]getAttribute and setAttribute 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 --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org