Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

adding object to request attribute

Posted on 2004-10-26
2
Medium Priority
?
203 Views
Last Modified: 2013-11-23
Can  i add an object to a request attribute.
I want to do (in Servlet)


 ResultSet  rs = stmt.executeQuery("SELECT * FROM userdetails");
 request.setAttribute("viewResult", rs);                 
RequestDispatcher view = request.getRequestDispatcher("jsp/viewUsers.jsp");
  view.forward(request, response);

when i try to fetch the attribute in the JSP using
      ResultSet rs = (ResultSet)request.getAttribute(rs);

i get an error. How can I do this?
0
Comment
Question by:jessica04
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 12408301
shouldn't that be
         request.getAttribute("viewResult");
?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12408321
Thanks :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question