permaculture playing cards*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes RequestDispatcher and form action Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "RequestDispatcher and form action Problem" Watch "RequestDispatcher and form action Problem" New topic
Author

RequestDispatcher and form action Problem

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634



i am confused when we have to put a forward slash in the
getRequestDispatcher("/login.html")

and
action="/abc"


why do we have to put the slash in the requestdispatcher when forwarding to a html or jsp page ?


OCPJP 6.0 93%
OCPJWCD 5.0 98%
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
You may or may not use /. Try removing it and check. The code should behave the same whether you have a / or not.
 
Consider Paul's rocket mass heater.
 
subject: RequestDispatcher and form action Problem