Home Web Front-end HTML Tutorial How to change html code into jsp code

How to change html code into jsp code

Apr 27, 2021 pm 04:05 PM
html jsp

How to change html code into jsp code: 1. Directly modify the Html file and add relevant code; 2. Replace the content in the [] tag in the html with the [] content in the jsp page.

How to change html code into jsp code

The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.

How to change html code to jsp code:

1. Directly modify the Html file:

Add code directly to the top of the original testPage.html page :

<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%>
Copy after login

Just change the suffix to jsp.

2. Create a new jsp file:

Replace the content in the tag in the html with the in the jsp page Just the content.

Note: The first line in the jsp page:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
Copy after login

is changed to:

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
Copy after login

How to change html code into jsp code

Extended information:

When converting HTML to XHTML, pay attention to the following points:

1. Add a description of the document type at the head of each page.

For example: "!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "》

Of course you can choose other types.

2. Both tags and names should be in lowercase.

You can write a replacement program yourself to change all the tags in your HTML document to lowercase letters, and the name attribute must also be changed to lowercase.

3. All attribute values ​​must be enclosed in quotation marks.

4. Separate tags.

For example: "hr", "br" and "img" must be ended by adding / at the end. It is not recommended to use methods such as "img" and "/img" here. Just add / directly after it, such as "br /".

5. Open the official website of W3C DTD: http://validator.w3.org/check/referer. General errors during verification may appear in your tag nesting. You can also use the conversion tool tidy provided by the official website to achieve the conversion: http://www.w3.org/People/Raggett/tidy/,

6. Open the following page directly and enter the URL directly to verify Our program: http://validator.w3.org/check?uri=http://moban.7880.com/

Related learning recommendations: html video tutorial

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

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

Nested Table in HTML

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Table Border in HTML

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

HTML margin-left

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

HTML Table Layout

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Moving Text in HTML

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

HTML Ordered List

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

How do you parse and process HTML/XML in PHP?

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

HTML onclick Button

See all articles