This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Request Dispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Request Dispatcher" Watch "Request Dispatcher" New topic
Author

Request Dispatcher

Danny Scott
Greenhorn

Joined: Apr 04, 2001
Posts: 2
Hi!
I have the following code in my servlet. I wana call a jsp from the servlet and i'm using a java bean. But when i compile it i get message RequestDispatcher(line 5) class not found and method request.setAttribute(...)not found.(line 3)
I've also read that RequestDispatcher is a interface.....???

1. MemberBean member=new MemberBean(userid);

2. ServletContext xx=getServletContext();
3. request.setAttribute("member",member);
4. String jsp="member.jsp";
5. RequestDispatcher disp=xx.getRequestDispatcher(jsp);
6. disp.forward(request,response);
Malu Sivasankar
Greenhorn

Joined: Aug 02, 2000
Posts: 14
Hello,
Are U using the version 2.2 of Servlet API??
Bhanu manne
Greenhorn

Joined: Apr 02, 2001
Posts: 8
Ya just check out whether you are using servlet version 2.1 and above because request dispatcher is not supported by previous versions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Request Dispatcher
 
Similar Threads
Why not RequestDispatcher?
problem loading jsp from servlets
Sorting ArrayList of MemberBean objects
setting an attribute on the httprequest within a jsp
Access to a property of JavaBean