Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

request.getRequestDispatcher

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On configuration Apache Tomcat/5.5.9 jre 1.5.0_02-b09 Windows XP, webapps work like a charm.

But on configuration Tomcat/5.0.27 1.4.2_05-b04 Linux Debian, i always have a NullPointerException when using request.getRequestDispatcher(URL).forward(request,response)

I don't know why and you ?

thanks
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's the URL of the file you're trying to forward to?
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"dahwoud dahwoud",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
david dahwoud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry :-)
 
david dahwoud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
minimal test servlet



the test.jsp used as forward



test.jsp location:

WebApp directory
|---------------test.jsp
|---------------WEB-INF

getRequestDispatcher from request or servletContext throw nullpointerexception
[ July 07, 2005: Message edited by: david dahwoud ]
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try:
RequestDispatcher rd = request.getRequestDispatcher("/test.jsp");
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
genarally we will write the Request dispatcher in servlet by

public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException
{
RequestDispatcher rd=req.getRequestDispatcher("some jsp file");
rd.forward(req,res);
}

i think that in your case u have misplaced the jsp file so u put the jsp page under context path and try it
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"kumarbobby",
You have changed your display name from "vinay krothapalli kumar" and unfortunately your new display name is not valid. Please change it back, since accounts with invalid display names get deleted.

thanks,
Dave.
 
david dahwoud
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
test.jsp is well in servlet context path :-(
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by dahwoud dahwoud:
On configuration Apache Tomcat/5.5.9 jre 1.5.0_02-b09 Windows XP, webapps work like a charm.

But on configuration Tomcat/5.0.27 1.4.2_05-b04 Linux Debian, i always have a NullPointerException when using request.getRequestDispatcher(URL).forward(request,response)

I don't know why and you ?

thanks



Is '1.4.2_05-b04' a full j2sdk or is it just a JRE?
Tomcat 5.0x requires a full JDK (j2sdk) to compile JSPs.
 
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David - Are you compiling and building under the 1.5 system, then deploying under the 1.4 runtime?

Guy
 
reply
    Bookmark Topic Watch Topic
  • New Topic