简体   繁体   中英

How to change HTML in servlet page?

So, i want have a servlet something like this

在此处输入图片说明

But my page looks like this

在此处输入图片说明

Here my web.xml

在此处输入图片说明

You have to change the content type to text/html

response.setContentType("text/html;charset=UTF-8");

what you have is

response.setContentType("text/plain;charset=UTF-8");

Hence the browser treating it as text.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM