• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query on RequestDispatcher  RSS feed

 
Rahul Jadaun
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this systax correct? What does '../' get you?

request.getRequestDispatcher("../html/copyright.html").include(request, response);
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the getRequestDispatcher of ServletRequest accepts relative paths. Relative to the current servlet. So "../" means the parent directory of the current servlet.
 
Boobalan Pillai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul Jadaun ,

I think ../anyresouces.xx is not relative to the application context.
you will get nullpointerexception if you forward or include any resouces with that url.

you will have to use like /anyresources.xx.

correct me if i am wrong

Regards
Bala
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!