File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes RequestDispatcher Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher Problem" Watch "RequestDispatcher Problem" New topic
Author

RequestDispatcher Problem

Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hi all
i m using RequestDispatcher object in the follwing way:
RequestDispatcher disp = req.getRequestDispatcher("path");
disp.include(req, res);
but i keep getting 500 "Internal Server Error"
what cud b the problem
tia
malhar


Malhar Barai
SOA & Java Book
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Could you post more data?. E.g., are you forwarding a POST to a static HTML page?


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
ye buddy,
it is forwarded to a static HTML page.
cud this be a problem..???!!

Originally posted by Tony Alicea:
Could you post more data?. E.g., are you forwarding a POST to a static HTML page?

Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Rename *.html to *.jsp and see what happens. I don't think you can forward a POST to an static HTML page. I think you CAN forward a GET to a static HTML page though...
sridhar satuloori
Ranch Hand

Joined: Nov 05, 2001
Posts: 144
May i know which servlet engine you are using.
As far as i know there is no restriction of forward or include. we can forward or include static or dynaimc pages
Sridhar
Originally posted by Tony Alicea:
Rename *.html to *.jsp and see what happens. I don't think you can forward a POST to an static HTML page. I think you CAN forward a GET to a static HTML page though...

Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
dear
i m using Apache 1.3.6. its easy fr me to go in response.sendRedirect...
cant go fr .jsp as the entire proj has to be done using servlets
rgds
malhar
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Tony is correct, Sridhar. Since forwarded requests use the same request method as the original request, POST requests cannot be forwarded to normal HTML pages. The solution is to rename HTML pages to have a .jsp extension
------------------
Bosun
SCJP for the Java� 2 Platform


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher Problem