How to change html code into jsp code

coldplay.xixi
Release: 2023-01-05 16:12:00
Original
6983 people have browsed it

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template