Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement JSP with tomcat

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to achieve JSP in tomcat. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

I'll tell you how tomcat implements JSP.

Preliminary knowledge:

1. Bytes and unicode

The Java kernel is unicode, even class files, but many media, including file / stream, are saved.

It uses byte streaming. So Java has to convert these byte streams through lines. Char is unicode and byte is byte.

[@ more@] the byte/char interchange function in Java is found in the middle of the sun.io package. Where the ByteToCharConverter class is the medium scheduling

Can be used to tell you that you use Convertor. Two of the commonly used static functions are

Public static ByteToCharConverter getDefault ()

Public static ByteToCharConverter getConverter (String encoding)

If you do not specify converter, the system will automatically use GBK,EN on the current Encoding,GB platform

8859_1

Let's take a simple example:

Your GB code is: 0xC4E3, unicode is 0x4F60

You use:

-- encoding=gb2312

-- byte b [] = {(byte) u00c4, (byte) u00E3}

-- convertor=ByteToCharConverter.getConverter (encoding)

-char [] c=converter.convertAll (b)

-- for (int itemositani)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report