Xampp, Tomcat, jsp pages show source code [Answered]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Xampp, Tomcat, jsp pages show source code [Answered]

Postby MintDarkGoblin » 22. August 2012 05:28

Hello I am using Tomcat with Xampp 1.8 (control panel version 3.0.12) to serve .jsp pages but the browser (Firefox 14) show the source code on the served page when it is in the xampp/tomcat/webapps folder. If I move the .jsp file to the xampp/webapps/examples folder the .jsp works. Why? By the way what is a WEB-INF folder? I am using Windows 7 operating system.

Code: Select all
<%@page contentType="text/html" import="java.util.*" %>
<HTML>
 <HEAD>
  <TITLE>Hello World</TITLE>
 </HEAD>
 <BODY>
  <H1>Hello World</H1>
  Today is: <%= new java.util.Date() %>
 </BODY>
</HTML>
MintDarkGoblin
 
Posts: 2
Joined: 22. August 2012 05:16
Operating System: Windows 7

Re: Xampp, Tomcat, jsp pages show source code

Postby JonB » 22. August 2012 14:31

OK - I am NOT expert with Tomcat, but I think I can explain

Apache acts as a proxy for Tomcat so that things can run over port 80. Tomcat is an app server primarily, not a webserver. I.e. Apache is an output device/stream for Tomcat. (think about how Java is a sandbox/walled garden that runs locally - in this case on your server) I need my pile of stones (therefore) - what is in the Tomcat server folder is local to that instance of tomcat. You probably could address those objects over a port configured for tomcat, I think 8080 is the one used.

If you look in httpd.conf you will find this lime:

Include "conf/extra/httpd-ajp.conf"

Look in that file to see how it works.

This has a good explanation:
http://www.roseindia.net/servlets/tomcat-server.shtml

I hope that helps explain it.
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Xampp, Tomcat, jsp pages show source code

Postby MintDarkGoblin » 23. August 2012 17:27

Thank for the information it clears up a lot of confusion.
MintDarkGoblin
 
Posts: 2
Joined: 22. August 2012 05:16
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 145 guests