View Full Version : JSP Displaying as Plain ASCII

11-28-2004, 05:40 PM
I downloaded a free JSP script from a code website and it says all you need to do is upload it and access it using a web browser and it will work but it is just displaying the source code. I checked and my schools server is running Tomcat 5 ... any ideas why it is just showing up as the code?

11-29-2004, 05:59 PM
1) Do not cross post your question in multiple forum categories- When posting, there is no excuse to post the same question in multiple categories in hopes of getting a quicker response.
Read the rules man...

11-29-2004, 09:46 PM
Where did you upload your jsp files to?

just write a simple jsp page and upload to the same location to see if it works. copy this code and save it as sample.jsp

The time is now <%= new java.util.Date() %>

Also, what don't know what jsp script you are using, if the sample.jsp works, then you have to tell me more about the free script you have

11-30-2004, 02:29 PM
I asked my prof from my web programming class why I was having this problem, he said it is because I DO NOT have Tomcat running on the server. He said that they put the files onto the server but never installed it over the summer(go figure). In order to get my JSP scripts to work I would have to manually install Tomcat onto the server. Does anyone know any sites that have instructions on how to do this?

11-30-2004, 10:28 PM

that's where I learn how to install, it's very good. looks lots to read, but it's not cuz only one page.

01-03-2005, 05:25 AM
if you downloaded the code and just pasted it on a file in a java web server, make sure it is wrapped around <% %> to make it work otherwise it will just display as plain text.

for functions / methods, use <%! %>

to display the value use: <%= %>

first though, make sure it is a java web server or wait until your professor install one on it.

02-17-2005, 06:59 PM

02-18-2005, 04:11 AM
for functions / methods, use <%! %>

Also for properties that you wish to have persistent. IMO it makes more sense to declare functions in beans or custom tags for use in JSP but I have limited experience with J2EE in general so I can't speak from it.

He's already figured out that the problem is his school not having installed Tomcat though, and the problem (if it still exists) is how to install it.

As a tip, server.xml is not nearly as hard to understand if you dive right into it.