H
harryos
While trying out a tutorial about RequestDispatcher ,I came across
some servlet code like this
doGet(...) {
....
RequestDispatcher dispatcher =request.getRequestDispatcher("/
viewPostedData.jsp?"+querystr);
dispatcher.forward(request,response);
}
When I tried this with
request.getRequestDispatcher("viewPostedData.jsp?"+querystr);
I found that the servlet invokes the viewPostedData.jsp with the given
query string.So what was the need for a '/' in front of the name of
the jsp file?
Can somebody clarify this?
thanks,
harry
some servlet code like this
doGet(...) {
....
RequestDispatcher dispatcher =request.getRequestDispatcher("/
viewPostedData.jsp?"+querystr);
dispatcher.forward(request,response);
}
When I tried this with
request.getRequestDispatcher("viewPostedData.jsp?"+querystr);
I found that the servlet invokes the viewPostedData.jsp with the given
query string.So what was the need for a '/' in front of the name of
the jsp file?
Can somebody clarify this?
thanks,
harry