Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher? wat shld be the classpath?

 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys!
I am using jdk1.3.1; jsdk2.0; tomcat 3.2.2;
what should be the classpath to make RequestDispatcher work...
If somebody throws some light on how request dispatcher works it will be even better
I am trying to send some info frm a servlet to a jsp.. The code goes like this...
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/Login.jsp");
dispatcher.include(req, res);
compiler is giving error as getRequestDispatcher not found;
please help me
TIA
Ravi
 
Steve Granton
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The class is in the j2ee.jar, which will probably be included into the classpath of the container - though you will need to add it to your classpath for compilation.
In order to automate the build process you could use Ant from the Apache Jakarta Project (http://jakarta.apache.org/ant/manual/)
As for how to use the RequestDispatcher - take a look at the API docs at java.sun.com or do a search on this forum - I'm sure there has been plenty said about it.
Cheers,
Steve
 
timothy zimmerman
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.RequestDispatcher is in the servlet.jar that you should have gotten with tomcat look in the TOMCAT_HOME lib directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic