tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Apache Tomcat displays text/plain
Date Fri, 17 Oct 2014 17:12:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

R.Sriram,

On 10/17/14 9:06 AM, R.Sriram wrote:
> I am running my Java Servlet based application on 64bit Amazon
> Linux 2014.03 v1.0.3 running Tomcat 7 Java 7.
> 
> The webpage is displaying code rather than content. The code shows
> my HTML has sent content type ="text/html". When I do function f12
> click on Network and the domain, the left panel shows Content
> Type="text/plain". This is happening on all browsers that I tried
> with.

When you say that the HTML has sent content type="text/html", what do
you mean? In a <META> tag? Or in the server's response headers?

Is there anything between Tomcat and the client, such as a proxy web
server, etc.?

> I have been running this application on my local machine with
> Window and Apache Tomcat 7.0.50 for a long time and haven't had
> this problem ever.
> 
> AWS asked me to include the attached config in .ebextensions. The 
> problem got fixed for a few days, then it reverted back to display
> as "text/plain".

Does .ebextensions still contain your modification?

> Then AWS asked me to include the following mime-mapping lines in my
> web.xml:
> 
> <mime-mapping> <extension>htm</extension> 
> <mime-type>text/html</mime-type> </mime-mapping>

Are you using URLs ending in ".htm"?

> <mime-mapping> <extension>html</extension> 
> <mime-type>text/html</mime-type> </mime-mapping> <mime-mapping>

> <extension>body</extension> <mime-type>text/html</mime-type>

> </mime-mapping>

Note that all of these mime-mappings are included by default in
Tomcat. There should have been no need to specify them.

> this worked for a few days, then it reverted back to display as
> "text/plain"
> 
> Can someone have an explanation as to why this is happening and
> suggest a solution for this please.

I believe this is entirely related to your deployment within "AWS".
Are you just running Tomcat on an EC2 instance? I've never had any of
the problems you are describing. I've never even heard of a
.ebextensions file. Are you using something like Elastic Beanstalk? If
so, you're either going to have to be very lucky that someone areound
here can help, or you'll need to go get support from Amazon.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUQU37AAoJEBzwKT+lPKRY4TwQALEgCE32pmh2scI/lM9wGKqM
0i1mXBelDUfgqYYxKpPocddNC9gvHjffMzHmT1eOiIsQIr+VRsYwfV0dTn98jyA3
+rgX1UR/wQMw6qxWjraiM3f3QHRi9Ufror/xf1i1EkzrCMU7+Zki8vUjQMXbVg2s
6pE0ZccXWIcVm9kx+PPpGZmdya90QThxLmW+EIQ1Pv+iWmEJ2A+vLModbyQoBvK2
Xlwim/vgMStaaw/aUp8x+8V5NqBkxarDSacuut71CcPrAAV62njroARftLYxY+nr
m8amRwVQpBAO+sDfgY7Lbt18VBreTNsWReE88I5AdUvLJsYYoT0+Jxu0JGZehvMi
+2fIOpK/vO6i9WiJLlA6J5LDfsywoEOt/LUZk8YPtjtqe5AaeDsMsIwlgAIjqaPx
tnv4DqWssCtUXUBh5CzBQiNCar30S3FChfi21Cz0HjA5v2i9Ms3yJvqS2977Dlmj
wcmPWQgn9zrzY+0iIBF+sASFGUOfSfPvUSIB6p810RCU/uj2VfChzZVe/jzCOTni
VhfkqCbS26t3Lc+zyGrXWnLMFw00wd+ZBGMxYyvRVbGU8ViVmnh7JHWA3A13cV03
Zp8GWNpiO1f9+QzMMZtIMXIdAM0KA0UwX4StzLqmXDagfg+hjhvICK/mmYfYSWHi
ry6nHdw5vHXeRgvbcC5c
=jc1f
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message