I'm inherited a jsp application and have loaded it to a shared web hosting platform. When I load the page, it works fine in Internet Explorer but in any other browser I see a listing of the source code. Obviuosly I have something missing or incorrect but I've never used jsp code before so I would appreciate any help correcting this problem. Thanks in advance.

Any chance you can display the code that is bugging? (or being displayed wrong on ? browser)

Any chance you can display the code that is bugging? (or being displayed wrong on ? browser)

Any file with the .jsp extension displays the source code in Firefox. Even the simple Hello World routine below:
<html>
<head>
<title>My first JSP page
</title>
</head>
<body>
<%@ page language="java" %>
<% out.println("Hello World"); %>
</body>
</html>

This definitely seems like a configuration issue of your hosting provider and normally happens when the requested resource is fetched directly by the web server instead of being redirected to Tomcat and allowing it to process your JSP request. The suggestions provided in this thread might help you out.

This definitely seems like a configuration issue of your hosting provider and normally happens when the requested resource is fetched directly by the web server instead of being redirected to Tomcat and allowing it to process your JSP request. The suggestions provided in this thread might help you out.

Thanks for the link to this thread. I've read it and don't see a clear answer to the problem but will try some variations on the suggestions to see if anything works. It appears I might need a web.xml file to mine map but I'm totally unclear on what's needed to get jsp code to run on a server. Hopefully someone will be able to tell me or direct me to a resource to figure this out. But I will keep trying. Thanks.

> I'm totally unclear on what's needed to get jsp code to run on a server

You'd need a WAR file for your web project which needs to be deployed on Tomcat to make it all work. Google around for "creating war file" and "deploying war file on Tomcat" for more details. After your WAR file is successfully deployed, test your application on http://yourhost:8080/your-war-name/your-jsp . Let us know if you are facing any issues with this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.