File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from Marcus Green

 
Amirr Rafique
Ranch Hand
Posts: 324
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why this code will give run time error
 
Priya Viswam
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pathname must begin with a "/".

so change
RequestDispatcher dis = sc.getRequestDispatcher("menu.jsp");

this to
RequestDispatcher dis = sc.getRequestDispatcher("/menu.jsp");

and it will work.
 
warren li
Ranch Hand
Posts: 128
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext getRequestDispatcher's parameter must start with a /
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic