Two Laptop Bag*
The moose likes JSP and the fly likes RequestDispatcher not working..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "RequestDispatcher not working..... " Watch "RequestDispatcher not working..... " New topic
Author

RequestDispatcher not working.....

Raul Martinez
Greenhorn

Joined: Mar 01, 2004
Posts: 17
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




Learning new things, I LIKE!<p>---certification---<br />none so far, experience (considerable, yeah)
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Hi,
You dont need to give context name testbed as the part of forward URL.


Groovy
Raul Martinez
Greenhorn

Joined: Mar 01, 2004
Posts: 17
it worked!! Yehey! thank you very much! Duke
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
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.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Raul Martinez
Greenhorn

Joined: Mar 01, 2004
Posts: 17
thanks! got it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher not working.....
 
Similar Threads
2) getContext - absolute path
regarding session transfer from servlet to jsp
error message
Can I use object in JSP which is created in servlet?
Request Resource not available JSP