This is a system built by my company. In it, we often see HTML code embedded in the if-else statement of jsp. I have not found this syntax in all the jsp and javascript books, and what I know The thing is that the jsp code will be compiled on the server side and the result will be sent to the browser, while html and js will be executed directly on the browser side. So what is the compilation or execution mechanism of code in this form?
<%%>
What is wrapped is the logical code part, and what is not wrapped is output directly.Like this
For example, when the browser requests a certain jsp, the jsp renders the above code into html on the server side, and then returns it to the browser. I can’t understand the content of the
<%%>
part on the browser side.Perhaps the questioner can look for knowledge about "templates"?
It is recommended that you learn about servlets