Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the content-type of a jsp file?

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 ?
like image 226
John Doe Avatar asked Jan 26 '26 12:01

John Doe


1 Answers

The 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" %>
like image 96
user7294900 Avatar answered Jan 29 '26 00:01

user7294900



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!