• 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

ServletExec and RequestDispatcher

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using ServletExec to process my Servlets/JSPs and am having problems using the following code to forward a request on:
RequestDispatcher dispatcher = request.getRequestDispatcher(address);
dispatcher.forward(request, response);
If I put the servlet class in the default servlets directory it works no problem, however if I configure a Web Application and put the servlet class in the WEB-INF\classes directory it throws a NullPointerException as the getRequestDispatcher method returns NULL.
Any ideas why it works as a 'stand-alone' servlet but not as part of an app?
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try checking the servlet mapping in in the web.xml file. Also chk the path u are specifying while constructing the RequestDispatcher.
-Kaustubh
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic