How Can You invoke other web resources (or other servelt / jsp ) ?

Servelt can invoke other Web resources in two ways: indirect and direct.
Indirect Way : Servlet will return the resultant HTML to the browser which will point to another Servlet (Web resource)
Direct Way: We can call another Web resource (Servelt / Jsp) from Servelt program itself, by using RequestDispatcher object.
You can get this object using getRequestDispatcher("URL") method. You can get this object from either a request or a Context.
Example:
RequestDispatcher dispatcher = request.getRequestDispatcher("/jspsample.jsp");
if (dispatcher != null)
dispatcher.forward(request, response);
}


1 comment :


  1. The information that you shared with us is very useful and thanks for sharing. Also, many thanks for permitting me to comment!

    Quicken Support Number

    Quicken Online Support Number

    Quicken tech Support Number

    HP Support Number

    ReplyDelete