Solution to prompt downloading when accessing JSP file or servlet file

Time:2021-6-9

As shown in the figure below:
错误信息:您想保存此文件吗?
The same program, some browser error, some browser error. The cause of the error is the wrong code to set the MIME type.
If it is a JSP file, look at the file header:

Copy codeThe code is as follows:
<%@ page contentType=”text/html;charset=gb2312″%>

If it’s a servlet file, check:

Copy codeThe code is as follows:
response.setContentType(“text/html;charset=gb2312”);

Recommended Today

What is “hybrid cloud”?

In this paper, we define the concept of “hybrid cloud”, explain four different cloud deployment models of hybrid cloud, and deeply analyze the industrial trend of hybrid cloud through a series of data and charts. 01 introduction Hybrid cloud is a computing environment that integrates multiple platforms and data centers. Generally speaking, hybrid cloud is […]