当前位置:网站首页>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
下载资源
调试页面
边栏推荐
猜你喜欢
continue和break的区别与用法
Application Security Series 37: log injection
Hongliao Technology: Liu qiangdong's "heavy hand"
Station B Liu Erden - linear regression and gradient descent
59. Spiral matrix
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
华为路由器如何配置静态路由
C language learning notes (mind map)
Node 之 nvm 下载、安装、使用,以及node 、nrm 的相关使用
巨杉数据库再次亮相金交会,共建数字经济新时代
随机推荐
大型网站如何选择比较好的云主机服务商?
c语言——冒泡排序
Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
Li Chuang EDA learning notes 12: common PCB board layout constraint principles
Clear floating mode
Huawei BFD configuration specification
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
Pay attention to the details of pytoch code, and it is easy to make mistakes
Station B Liu Erden - linear regression and gradient descent
应用安全系列之三十七:日志注入
Raised a kitten
嵌入式面试题(四、常见算法)
Rustdesk builds its own remote desktop relay server
continue和break的区别与用法
Station B Liu Erden softmx classifier and MNIST implementation -structure 9
[Baiwen smart home] first day of the course_ Learn Embedded and understand the development mode of bare metal and RTOS
[paper reading] nflowjs: synthetic negative data intensive anomaly detection based on robust learning
如何在业务代码中使用 ThinkPHP5.1 封装的容器内反射方法
The usage and difference between strlen and sizeof
清除浮动的方式