The difference between the Compilation instruction and action instruction in JSP is two points:
Differences between the Compilation instruction and action instruction in JSP
1. The compile command notifies the Servlet engine to process messages, and the Action Command is only the script action during running.
2. The compilation command works when JSP is compiled into Servlet, and the action command can be replaced with JSP script, which is the standardized writing method of JSP script.
What are the differences between the compilation commands and action elements on jsp pages?
JSP command:
Expression <% @ include tile = "" %>
This command only contains static files. It cannot be a dynamic address without any parameters. The server will compile the files that contain recent files.
JSP action elements:
Expression <JSP: include page = "">
It can contain static or dynamic files. When a static file is included, the server does not compile the contained file. When a dynamic file is included, the server compiles the dynamic file, the system automatically determines whether the file is dynamic or static.
Unlike the include command, this action element inserts a specified file into the server's response output only when the JSP page is requested by the user.
What are the differences between actions and commands in JSP?
Hello, use include for example.
The include command is a command in the compilation phase. That is, the content of the file contained in include is inserted into the JSP file during compilation. the JSP Engine judges that the JSP page has not been modified, otherwise, it is deemed to have been modified. Because the contained file is inserted during compilation, if only the content of the include file is modified but not the JSP file is not modified, the structure will not be changed, therefore, you can directly execute an existing bytecode file without re-compiling it. Therefore, it is appropriate to use the include command for infrequently changed content,
If the required content changes frequently, the Action Element <jsp: include> is required.