• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RequestDispatcher not working.....

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RequestDispatcher didn't work (for me.) I have a servlet that accepts GET/POST
parameter called doorId and based on that doorID.. the servlet (WebGate) must forward the request
to a specific JSP file under the WebGate Doors (see below).
If I type http://192.168.1.11:8080/testbed/servlet/test.WebGate?doorId=1 the servlet
should have forward the request to door1.jsp (see below). But Tomcat display a 404 error


Tomcat said:
HTTP Status 404 - /testbed/jspTest/WebGate/doors/door1.jsp
type Status report
message /testbed/jspTest/WebGate/doors/door1.jsp
description The requested resource (/testbed/jspTest/WebGate/doors/door1.jsp) is not available.
[/QUOTE>
But /testbed/jspTest/WebGate/doors/door1.jsp actually exists...

My Development Environment:
APP ROOT: http://192.168.1.11:8080/testbed/
WebGate Doors: /testbed/WebGate/doors/
Available files under /testbed/WebGate/doors/


-rw-r--r-- 1 root root 85 Mar 12 15:26 door1.jsp
-rw-r--r-- 1 root root 85 Mar 12 15:26 door2.jsp
-rw-r--r-- 1 root root 85 Mar 12 15:26 door3.jsp
-rw-r--r-- 1 root root 85 Mar 12 15:26 door4.jsp
-rw-r--r-- 1 root root 106 Mar 12 15:27 doorCATC.jsp



 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You dont need to give context name testbed as the part of forward URL.
 
Raul Martinez
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it worked!! Yehey! thank you very much! Duke
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the RequestDispatcher is relative to the context, so when you do the forward, the root is already the context, and you just need to give the remaining path for forwarding.
Nick.
 
Raul Martinez
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks! got it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic