当前位置:网站首页>ContentType的作用
ContentType的作用
2022-07-06 05:48:00 【緈福的街口】
文章目录
一、ContentType的作用
ContentType决定浏览器采用何种方式对响应体进行处理
二、不同类型的表现效果
对以下程序实现不同表现效果
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String output = "<h1><a href='http://www.baidu.com'><span>百度</span></a></h1>";
response.setContentType("text/html;charset=utf-8");
response.getWriter().println(output);
1、text/html:html文档
text/html
html文档
调试页面
2、text/plain:纯文本
text/plain
纯文本
调试页面
3、text/xml:XML文档
text/xml
XML文档
调试页面
4、application/x-msdownload:需要下载的资源
application/x-msdownload
下载资源
调试页面
边栏推荐
- Closure, decorator
- The difference and usage between continue and break
- 【经验】win11上安装visio
- 关于 PHP 启动 MongoDb 找不到指定模块问题
- 养了只小猫咪
- How can large websites choose better virtual machine service providers?
- Market development prospect and investment risk assessment report of China's humidity sensor industry from 2022 to 2028
- Memory and stack related concepts
- 【SQL server速成之路】——身份验证及建立和管理用户账户
- c语言——冒泡排序
猜你喜欢

Station B, Master Liu Er - dataset and data loading

如何在业务代码中使用 ThinkPHP5.1 封装的容器内反射方法

Download, install and use NVM of node, and related use of node and NRM

wib3.0 跨越,在跨越(ง •̀_•́)ง

First knowledge database

Network protocol model
![[Jiudu OJ 07] folding basket](/img/a7/e394f32cf7f02468988addad67674b.jpg)
[Jiudu OJ 07] folding basket

Web服务连接器:Servlet
![[JVM] [Chapter 17] [garbage collector]](/img/f4/e6ff0e3edccf23399ec12b7913749a.jpg)
[JVM] [Chapter 17] [garbage collector]

Game push image / table /cv/nlp, multi-threaded start
随机推荐
PDK工艺库安装-CSMC
Network protocol model
Query the standard text code corresponding to a work center (s) in the production order
Auto. JS learning notes 17: basic listening events and UI simple click event operations
【课程笔记】编译原理
c语言——冒泡排序
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
What preparations should be made for website server migration?
Station B Liu Erden - linear regression and gradient descent
Station B, Mr. Liu Er - multiple logistic regression, structure 7
Text classification still stays at Bert? The dual contrast learning framework is too strong
进程和线程
SequoiaDB湖仓一体分布式数据库2022.6月刊
26file filter anonymous inner class and lambda optimization
59. Spiral matrix
Game push: image / table /cv/nlp, multi-threaded start!
29io stream, byte output stream continue write line feed
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
How to download GB files from Google cloud hard disk
B站刘二大人-反向传播












