Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Servlets
How to Forward a request to another Servlet
Vishnu Prakash
Ranch Hand
Posts: 1026
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am specifying the full path to the target
servlet
class "Test" from another servlet class.
RequestDispatcher dispatch = request.getRequestDispatcher("/WEB-INF/classes/com/example/posr/Test");
But I am getting Http 404 error stating The requested resource (/content-type-ex/WEB-INF/classes/com/example/posr/Test) is not available.
Whats wrong with this?
Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1
-
JSTL Tag Documentation
Keith Pitty
Ranch Hand
Posts: 32
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You need to specify the servlet mapping in the argument of getRequestDispatcher.
Vishnu Prakash
Ranch Hand
Posts: 1026
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks
Its actually the <url-pattern> element value of the <servlet-mapping> that has to be specified as argument to getRequestDispatcher(
String
path) method.
Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1
-
JSTL Tag Documentation
Keith Pitty
Ranch Hand
Posts: 32
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yes, to be exact it is the url-pattern of the servlet mapping. Did that fix your problem?
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
ListenerStart Error
how to set class path
Servlet in Package Issue
Compiling custom imports
HFSJ: Error while compiling servlet example
More...