JSP (Java Server Page) JSP directives and action elements

Source: Internet
Author: User

1. Include actions/ include directives

Include directive syntax: <%@ include file= "URL"%>

Include action syntax: <jsp:include page= "URL" flush= "true | False "></jsp:include>

  The difference between include actions and include directives:

Include directives Include action
Syntax format <%@ include file= "URL"%> <jsp:include page= "URL" flush= "true | False "/>
Time to take effect During page conversion Request Period
Include content The actual contents of the file Output of the page
Convert to Servlet The main page and the Include page are converted into a servlet The main page and the included page are converted into separate Serlvet
Compile time Slower (resources must be parsed) More quickly
Execution time More quickly Slower (each resource must be parsed)

    

2.forward action/Same forward effect code

Forward action syntax: <jsp:forward page= "URL" ></jsp:forward>

Same effect code: request.getrequestdispatcher ("/url"). Forward (ServletRequest req,servletresponse res);

3.param Action

   param action Syntax: <jsp:param name= "parameter name" value= "argument value"/>

 Xforward Action + param action

Format:
<jsp:forward page= "URL" >
<jsp:param name= "paramname" value= "Paramvalue"/>
</jsp:forward>

JSP (Java Server Page) JSP directives and action elements

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.