The argument to forward method is the name of the resource we want the request to be forwarded to. This can be a jsp file or a Servlet. In case it is a servlet, the argument should be whatever we have specified in the url-pattern for that servlet declaration in web.xml.
So, the point to be noted here is that in case we want to forward the request to some other servlet, the argument to forward method should be the url-pattern of that servlet.
Also, as we (probably) already know, the URL in the browser is not changed in case of forward. i.e. the client does not get to know that internally the request has been forwarded to some other resource.
No comments:
Post a Comment