admin管理员组文章数量:1391798
I'm trying to set a jsp file to load but i have a doubt on it.
What is the content-type of a .jsp file?
application/json or application/javascript ?
I'm trying to set a jsp file to load but i have a doubt on it.
What is the content-type of a .jsp file?
application/json or application/javascript ?
Share
Improve this question
edited Jan 22, 2018 at 13:04
soorapadman
4,5097 gold badges37 silver badges48 bronze badges
asked Jan 22, 2018 at 13:00
John DoeJohn Doe
391 gold badge1 silver badge2 bronze badges
3
- Do you want to run that file or download it? – rollstuhlfahrer Commented Jan 22, 2018 at 13:02
- run that file. @rollstuhlfahrer – John Doe Commented Jan 22, 2018 at 13:03
-
You mean default jsp ?
contentType="text/html;charset=UTF-8"
– soorapadman Commented Jan 22, 2018 at 13:03
1 Answer
Reset to default 2The default Content Type is text/xml
see Oracle's JSP Globalization Support
Without any page directive settings, default settings are as follows:
The default MIME type is text/html for traditional JSP pages; it is text/xml for JSP XML documents.
The default for the page source character encoding (for translation) is ISO-8859-1 (also known as Latin-1) for traditional JSP pages; it is UTF-8 or UTF-16 for JSP XML documents.
The default for the response character encoding is ISO-8859-1 for traditional JSP pages; it is UTF-8 or UTF-16 for JSP XML documents.
You can override it with the following attributes (specifically contentType
):
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="US-ASCII" %>
本文标签: javascriptWhat is the contenttype of a jsp fileStack Overflow
版权声明:本文标题:javascript - What is the content-type of a jsp file? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744771342a2624357.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论