In JSP web pages, we often introduce some packages or required classes. At this time, import is required, but import has different usage, among which jsp: directive. the usage and interpretation of page import = "" are as follows:
The code is as follows: |
Copy code |
<Jsp: directive. page import = "zero. space. ch03.BookBean"/> |
Equivalent
The code is as follows: |
Copy code |
<% @ Page import = "zero. space. ch03.BookBean" %> |
But there are also differences: the two uses have different scopes,
The code is as follows: |
Copy code |
<% @ Page import = "zero. space. ch03.BookBean" %> |
Can be used in multiple pages
The code is as follows: |
Copy code |
<Jsp: directive. page import = "zero. space. ch03.BookBean"/> |
It can only be used for one page and cannot be called across pages.
For example, if you include all the class packages in one JSP, you can include the jsp in other jsp. In this case, the introduced class must adopt
The code is as follows: |
Copy code |
<% @ Page import = "zero. space. ch03.BookBean" %>
|
This statement.
The code is as follows: |
Copy code |
<Jsp: directive. page import = "zero. space. ch03.BookBean"/> |
This method can only be used on the same jsp page and cannot be called across pages.