what language is used in jsp
A JSP page can be divided into the following parts: static data, such as HTML, css, js, JSP instructions, such as include instructions, JSP script elements and variables, JSP actions, user-defined tags, static data, etc.
The content of the static data in the input file is exactly the same as the content output to the HTTP response. At this time, the JSP input file will be an HTML page without embedded JAVA or actions. Moreover, the client will get the same response content every time it requests.
JSP directive
The JSP directive controls how the JSP compiler generates servlets. The following are the available directives: Include directive include – The include directive tells the JSP compiler to completely include another file into the current file. middle. The effect is as if the contents of the included file are pasted directly into the current file. This functionality is very similar to that provided by the C preprocessor. The extension of the included file is generally jspf (JSPFragment, JSP fragment): <%@ include file=somefile.jsp %>
Page command page – The page command has the following options:
import causes a JAVA import statement to be inserted into the final page file.
contentType specifies the type of generated content.
Use when generating non-HTML content or when the current character set character set is not the default character set. errorPage When processing HTTP requests, if an exception occurs, the error message page will be displayed.
isErrorPage If set to TRUE, it means that the current file is an error page.
isThreadSafe indicates whether the final generated servlet is thread safe (threadsafe).
Note: Only the import page directive can be used multiple times in the same JSP file. Tag library directive taglib – The tag library directive describes the JSP tag library to be used. This directive needs to specify a prefix (similar to the C namespace) and the description URI of the tag library: <%@ taglib prefix=myprefix uri=taglib/mytag.tld %>
JSP Script
Standard script variables
The following are script variables that are always available:
out – the data used by JSPWriter to write to the response stream
page – servlet itself
pageContext – A PageContext instance contains data associated with the entire page. A given HTML page can be passed between multiple JSPs.
request – HTTP request object
response – HTTP response object
session – an object used to maintain the connection between the client and the server Script element
There are three basic scripts Element, its function is to enable JAVA code to be directly inserted into the servlet. One is to declare the tag and put the definition of a variable in the class body of JAVA SERVLET.
Static data members can also be defined in this way. <%! int serverInstanceVariable = 1; %> One is a script tag, which puts the included statement in the _jspService() method of the JAVA SERVLET class.
<% int localStackBasedVariable = 1; out.println(localStackBasedVariable); %> One is the expression tag, which puts the expression to be assigned in the JAVA SERVLET class. Note that the expression cannot start with End with semicolon. <%= expanded inline data 1 %>
JSP Action
JSP action is a series of XML tags that can call functions built into the web server. JSP provides the following actions: jsp:include Similar to the sub-process, JAVA SERVLET temporarily takes over the requests and responses to other specified JSP pages. When the JSP page is processed, control is immediately returned to the current JSP page. This way JSP code can be shared among multiple JSP pages without duplication.
jsp:param can be used between jsp:include, jsp:forward or jsp:params blocks. Specifies a parameter that will be added to the current parameter group of the request.
jsp:forward is used to handle requests and responses to another JSP or SERVLET. Control is never returned to the current JSP page.
jsp:plugin Older versions of Netscape Navigator and Internet Explorer use different tags to embed an applet. This action generates the specified browser tag required to embed an APPLET.
jsp:fallback The content that will be displayed if the browser does not support APPLETS. jsp:getProperty Gets a property value from the specified JavaBean. jsp:setProperty sets a property value in the specified JavaBean.
jsp:useBean Create or reuse a JavaBean variable to the JSP page.
JSP technology can be easily integrated into a variety of application architectures to leverage existing tools and techniques, and can be expanded to support enterprise-level distributed applications. As part of the Java technology family and an integral part of Java 2 (Enterprise Edition Architecture), JSP technology can support highly complex Web-based applications. Because the built-in scripting language of JSP pages is based on Java, and all JSP pages are compiled into Java Servlets, JSP pages have all the benefits of Java technology, including robust storage management and security. As part of the Java platform, JSP has the "write once, run anywhere" feature of the Java programming language.
The above is the detailed content of what language is used in jsp. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



jsp belongs to the backend. The essence of jsp is a servlet, and servlet is a server-side java application, so jsp is a back-end technology. JSP is deployed on the web server and can respond to requests sent by the client and dynamically generate web pages of HTML, XML or other format documents based on the request content, and then return them to the requester. JSP technology uses Java as a scripting language to provide services for user HTTP requests, and can handle complex business requirements together with other Java programs on the server.

The difference between jsp and html: 1. Operating mechanism; 2. Purpose; 3. Relationship with Java; 4. Function; 5. Relationship with back-end; 6. Speed; 7. Maintainability and scalability; 8. Learning and use Difficulty; 9. File suffixes and identification tools; 10. Community and support; 11. Security. Detailed introduction: 1. Operating mechanism. HTML is a markup language, mainly used to describe and define the content of web pages. It runs on the client and is interpreted and executed by the browser. JSP is a dynamic web page technology that runs on the server side, etc. wait.

After the new springboot project is created, the directory is as follows: Step 1: Add the jar package code required to configure jsp to the project's pom file: org.apache.tomcat.embedtomcat-embed-jasperprovided Step 2: Create a new directory webapp under the main path , create a new path WEB-INF under webapp, create a new path jsp under WEB-INF, and place the jsp file we want to use under this path. Step 3: Configure the access path and suffix code of the jsp file in the main configuration file: spring .mvc.view.prefix=/WEB-INF/jsp/sp

Implementation steps: 1. Introduce the JSTL tag library into the JSP page; 2. Obtain data from the database; 3. Paging the data; 4. Display the paging navigation bar in the page; 5. Display the number according to the current page number and each page. , just get the corresponding data from the paging data and display it on the page.

1. The core sql statement to implement paging query (1) The sql statement to query the total number of records in the database: selectcount(*)from+(table name); (2) The sql statement to query the number of records for each query: where: 0 is searched Index, 2 is the number of items searched each time. select*from table name limit0,2; 2. Code implementation* I wrote these two classes in the previous article, DBconnection class: used to obtain database connections, Author object class. Click on the link to view the code for these two classes. Click the link to view the DBconnection class and Author object class (1) Login page: index.jsp. Inserttitlehere user column

Can JSP be replaced by PHP? JSP (JavaServerPages) and PHP (HypertextPreprocessor) are commonly used server-side scripting languages for dynamically generating web page content. Although they each have their own characteristics and advantages, can they completely replace each other in practical applications? This article will analyze the advantages and disadvantages of the two and compare them through specific code examples. First, let's take a look at the respective characteristics of JSP and PHP. JSP is a Java-based

JSP is a dynamic web technology standard. Its file format is to insert Java program segments (Scriptlet) and JSP tags (tags) into traditional web page HTML files (.htm, .html) to form JSP files (*.jsp ).

JavaWeb development technology stack: Master JavaEE, Servlet, JSP, Spring and other technologies used for Web development. With the rapid development of the Internet, in today's software development field, the development of Web applications has become a very important technical requirement. As a widely used programming language, Java also plays an important role in the field of Web development. The JavaWeb development technology stack involves multiple technologies, such as JavaEE, Servlet, JSP, Spr
