JSP is similar to PHP, ASP, ASP.NET and other languages, and is a language that runs on the server side.

JSP (full name: Java Server Pages) is a tool initiated by Sun Microsystems and co-created by many companies that allows software developers to respond to client requests and dynamically generate HTML, XML or other format documents. Technical standards for web pages.

JSP technology uses Java language as a scripting language. JSP web pages provide an interface for the entire server-side Java library unit to serve HTTP applications.

The suffix of JSP files is *.jsp.

WEB applications developed by JSP can be used across platforms and can run on both Linux and Windows.

JSP syntax syntax

Script programs can contain any number of Java statements, variables, methods, or expressions, as long as they are valid in the scripting language.

Script syntax format:

<% code snippet%>

Alternatively, you can write its XML equivalent Statement, like the following:

<jsp:scriptlet>
Code snippet

</jsp:scriptlet>

Any text, HTML tags, and JSP elements must be written outside the script program.

JSP syntax example

<html>
    <head>
        <title>Hello World</title>
    </head>
<body>Hello World!<br/>
    <%out.println("Your IP address is " + request.getRemoteAddr());%>
</body>
</html>