" to the head of the html document and change the suffix name to ".jsp"; 2. Create a new jsp file, Copy the content of the original html document to the jsp file and delete the original html file."/> " to the head of the html document and change the suffix name to ".jsp"; 2. Create a new jsp file, Copy the content of the original html document to the jsp file and delete the original html file.">

Home >Java >javaTutorial >How to convert html to jsp

How to convert html to jsp

(*-*)浩
(*-*)浩Original
2019-05-18 13:29:1429563browse

Conversion method: 1. Add the jsp tag "" to the head of the HTML document, and change the suffix name to ".jsp". Yes; 2. Create a new jsp file, copy the content of the original html document to the jsp file, and delete the original html file.

How to convert html to jsp

The operating environment of this tutorial: windows7 system, jsp2.2&&html5 version, Dell G3 computer

Generally, change the html page to jsp There are two methods, the first is to directly modify the html file, and the other is to create a new jsp file.

1. Directly modify the Html file:

(1) Add the following code directly to the top of the original testPage.html page:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

How to convert html to jsp

(2) Modify the file suffix: Click on the original testPage.html file, press F2, modify the suffix to .jsp, and click OK.

How to convert html to jsp

How to convert html to jsp

2. Create a new jsp file

(1) The new file name is testPage. jsp file.

How to convert html to jsp

(2) Copy the contents of the original testPage.html file to the jsp file. Don't be so foolish as to cover the content of the jsp file header. Just cover the content of the html tag in the jsp file.

How to convert html to jsp

# (3) Delete the original testPage.html file.

html code:

Hypertext Markup Language (an application under Standard Universal Markup Language, foreign language abbreviation HTML) is by far the most widely used language on the Internet , is also the main language that constitutes web documents. HTML text is descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc. The structure of HTML includes two parts: Head and Body. The head describes the information required by the browser, and the body contains the specific content to be explained.

JSP:

The full name is Java Server Pages, and the Chinese name is java server page. It is basically a simplified Servlet design, which is advocated by Sun Microsystems. , a dynamic web technology standard that many companies participate in establishing. JSP technology is somewhat similar to ASP technology. It inserts Java program segments (Scriptlet) and JSP tags (tags) into traditional web page HTML (a subset of standard universal markup language) files (*.htm, *.html) to form JSP file, the suffix is ​​(*.jsp). Web applications developed with JSP are cross-platform and can run under Linux as well as other operating systems.

The above is the detailed content of How to convert html to jsp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:What is jsp source codeNext article:What is jsp source code