GeeCON Prague 2014*
The moose likes Servlets and the fly likes RequestDispatcher error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher error" Watch "RequestDispatcher error" New topic
Author

RequestDispatcher error

Shilpa Jain
Greenhorn

Joined: Aug 17, 2000
Posts: 16
I have written the following line in doGet() method
getServletContext().getRequestDispatcher("/servlet/ShowSession").include(request,response);
but the compiler is giving an error saying that :
HelloWorld.java:44: Method getRequestDispatcher (java.lang.String) not found in interface javax.servlet.ServletContext.
getServletContext().getRequestDispatcher("/servlet/ShowSession").include(request
,response);

Can anyone pls explain this?
thank you

[This message has been edited by Shilpa Jain (edited October 19, 2000).]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
This probably means you are using a servlet container which only implements an older version of the Servlet API. What server or container are you using, and which version?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Looks like he's using Servlets 2.0 ...?


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Shilpa Jain
Greenhorn

Joined: Aug 17, 2000
Posts: 16
Yes Iam using version 2.0. do i need to upgrade the version.
Shilpa
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hai Shilpa Jain
The Request Dispature mechanisum works with only JavaServlet vertion 2.1 on words.
Thank u
suresh
 
GeeCON Prague 2014
 
subject: RequestDispatcher error