当前位置:网站首页>JSP learning (2) -- JSP script elements and instructions

JSP learning (2) -- JSP script elements and instructions

2022-06-22 16:35:00 xiao_ zhu_ ting_ feng

 


1.0 jsp Script elements

Script element composition

1.1 Expression format

<%=java expression %>

  1. No spaces

  2. Non pluggable statement

  3. Must be able to evaluate

  4. Used to print variables or output values .

1.2 Scriptlet

Grammar format :<%java Code %>

  • No spaces

  • Classes and methods cannot be defined

  • Valid on current page , Will not be shared by other threads

  • You can write in it java Code for . Definition java Variables and writing java sentence .

1.3 Statement

Grammar format <%! Function or constant %>

  1. No spaces

  2. Valid throughout the page , Will be shared by multiple threads

  3. You can define global variables and methods in it , class .

2.0 Jsp Declaration and jsp scriptlet The difference between

count1 It's been accumulating , but count2 The value of does not change

2.1 Jsp Instructions

page Common attributes of instructions

 

原网站

版权声明
本文为[xiao_ zhu_ ting_ feng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221522245726.html