Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher Problem

 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post more data?. E.g., are you forwarding a POST to a static HTML page?
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic