• 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 Problem

 
Author
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic