Basic knowledge of jsp and El expressions, and jspel expressions

Source: Internet
Author: User

Basic knowledge of jsp and El expressions, and jspel expressions
1. jsp BASIC script and syntax format

Jsp script <% String name = "Tubo"; // java code %> jsp expression <% = name %>
2. jsp execution Principle

Jsp execution principle:

1) a jsp file -? Translate into a Java file -? _ 01_hello.java

2) Compile: a java file is compiled into a class file.

3) Call method: tomcat execute _ jspService (): jsp service method

3. Nine built-in jsp objects
PageContext // jsp context Object HttpRequest // request Object HttpSession // session Object (session) ServletContext // application Page // Object Throwable // exception JspWriter // outServletConfig // config
4. EL built-in object
PageContext -- not only the built-in objects in EL, but also the built-in jsp object pageScoperquestScopesessionScopeapplicationScopeparam. the built-in object for obtaining parameters <% String name = "Tubo"; % >$ {param ['name']}
5. jstl Technology

Use of jstl: You must import jar packages -- jstl-1.2.jar-to use these labels

<% @ Taglib uri = "https://java.sun.com/jstl/core" prefix = "c" %> // uri is the file ending with tld associated with the jar package
 
  
Content here
 // The prefix is
 
  
Content here
 
 
  
Page --> page domain request-> request domain session-> session domain application-> application domain
 
  
 
 
  
// When the boolean Type in test is true, the statement or code here is executed.
 
 
  
   
// Logic code
  
  
   
// Logic code
  
 
 

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.