This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request Dispatcher

 
Danny Scott
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Are U using the version 2.2 of Servlet API??
 
Bhanu manne
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya just check out whether you are using servlet version 2.1 and above because request dispatcher is not supported by previous versions
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic