tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Browser shows source of .jsp file. Why?
Date Sat, 25 Apr 2009 15:56:08 GMT


did you check your mime-mapping in your web.xml 
perchance are you mapping jsp to text/plain?
is any other extension mapped to text/plain?


Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de
This message is confidential. If you should not be the intended receiver, then we ask politely
to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message
serves only for the exchange of information and has no legal binding effect. Due to the easy
manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.

> Date: Sat, 25 Apr 2009 05:46:03 -0600
> From:
> To:
> Subject: Re: Browser shows source of .jsp file. Why?
> I'm having the same problem, where markup is sometimes appearing in the browser window
instead of the rendered HTML.
> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 behind a reverse
proxy on Apache 2.2.11.
> When I access one of my webapps via Tomcat's port (http://myserver:8080/Construction/)
it works fine.  When I access it via the reverse proxy (http://myserver/Construction) using
Firefox 3.0.9 I see the HTML markup displayed in the browser's window.  When I access the
webapp via IE either way, it works fine.  Google Chrome produces the same results as Firefox.
> Via Live HTTP Headers, when I access through the reverse proxy I see:
> HTTP/1.x 200 OK
> Date: Sat, 25 Apr 2009 11:39:11 GMT
> Server: Apache-Coyote/1.1
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/plain
> I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I see:
> HTTP/1.x 200 OK
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
> Transfer-Encoding: chunked
> Date: Sat, 25 Apr 2009 11:37:06 GMT
> No "Content-Type" produced at all.
> When I access it with Firefox via the Apache reverse proxy via the URL http://myserver/Construction/index.html
(which is just mapped in web.xml to the controlling servlet, and my welcome-file is index.html),
the webapp displays correctly, and the headers say:
> HTTP/1.x 200 OK
> Date: Sat, 25 Apr 2009 11:42:27 GMT
> Server: Apache-Coyote/1.1
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/html
> I have 3 different webapps, but I only see the problem with one of them.
> My reverse proxy configuration includes:
> ProxyPass        /Construction http://localhost:8080/Construction
> ProxyPassReverse /Construction http://localhost:8080/Construction
> David
> dfobox wrote:
> > I have JSP-based website running on my own server and I want to move it to
> > hosting company. I've copied the files, they said they have enabled Tomcat
> > for me, but browser shows source of the pages, even of those which don't
> > have any script code inside - only properly formatted html. What could be a
> > problem? Thanks!
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Rediscover Hotmail®: Get e-mail storage that grows with you.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message