[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

adding object to request attribute

Posted on 2004-10-26
2
Medium Priority
?
204 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
  • 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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

608 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