Home > Java > javaTutorial > body text

What is the jsp script?

little bottle
Release: 2020-09-15 16:15:26
Original
4395 people have browsed it

JSP script is also called java script. It is actually a Java code fragment, which refers to the java script in the jsp page enclosed by "<%%>"; all codes that can be executed in the java program are Can be executed through jsp script. JSP scripts are divided into three types: "<%...%>", "<%=...%>", "<%!...%>".

What is the jsp script?

JSP (Java Server Pages) is a dynamic resource on the JavaWeb server side. It has the same function as the html page, which is to display data and obtain data.

Composition of jsp: JSP = html Java script (code snippet) JSP dynamic tag

jsp script: also called java script in some places, refers to enclosed by <%%> java script in jsp page. All codes that can be executed in java programs can be executed through jsp scripts.

JSP script is a Java code snippet, which is divided into three types:

  • ##<%...%>: Java statement;

  • <%=…%>: Java expression;

  • <%!...%>: Java definition Class members;

#Variables defined in jsp scripts can also be used in jsp output expressions. For example:

<!-- 下面是JSP声明部分 -->
<%!
public int count;
public String info()
{ return "hello";}
%>
<%
Integer i=10;
out.println(count++);
%>
<%
out.println(info());
%>
<%=count++%>
<%=info()%>
<%=i%>
Copy after login

The above is the detailed content of What is the jsp script?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!