Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

servlet Request Dispatcher path

Hi,

I was reading as below.


Request Dispatcher


After supplying a String, a path to the JSP file If the path begins with a slash, it is relative to the current context root
Otherwise, it is relative to the servlet location.
Then we do
view.forward(request, response);

After added the result information to the HttpRequest object forward the whole thing to the JSP


I have not understood relative path to servlet location vs relative path to current context root. What is the difference between them and when we use which one and what are advantages and disavantages of each one. What is the absolute path and when we use it.

Please advise.

Any links resources ideas highly appreciated. Thanks in advance
SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

>>>If you do invoice/myinvoice.jsp the server will try to read c:/mywebsite/payments/paypal/invoices/myinvoice.jsp. This is called relative path.



relative path seems not suitable for above requirement.

So relative means relative to the folder of the source page(apayment.jsp )

Please confirm
So relative means relative to the folder of the source page(apayment.jsp )
Yes.