Saturday, 1 March 2014

What are the options in JSP to include files?

In JSP, We can able to include the files using below listed ways.

  • By include directive: For example:
     
    <%@ include file=”filename.jsp %>
  • By include action: For example:
     
    <%@ include file=”filename.jsp %>
  • By using pageContext implicit object For example:
     
    <%
         pageContext.include(“/filename.jsp”);
    %>
  • By using RequestDispatcher object: For example:
     
    <%
     RequestDispatcher rd = request.getRequestDispatcher(“/filename.jsp”);
      Rd.incliude(request,response);
    %>

No comments:

Post a Comment

Thank you so much for providing your valuable feedback. I will will look into them and update my skills & technologies accordingly.