File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes JSP configuration issues (displays code) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP configuration issues (displays code)" Watch "JSP configuration issues (displays code)" New topic
Author

JSP configuration issues (displays code)

C Harrison
Greenhorn

Joined: Aug 16, 2011
Posts: 3
I am having an issue running a custom JSP page on my server, it just displays the source code. It appears like the server is
serving the JSP file as text/plain, with no JSP processing, and without telling the browser that it's actually html.

Here is some information I have on hand not sure how useful it is:
- ran /usr/sbin/httpd2 -M and mod_jk is loaded on the server
- ran /usr/sbin/httpd2 -l and it returned:
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
- ran ps aux | grep -i tomcat and the process was running

- apache: 2.2.15
- tomcat: 6.0.29
- OpenSuse 11.4
- Linux version 2.6.34-12-desktop

I have been stuck at this point for quite some time and am not sure what steps to take to try and resolve this. Any help would be much appreciated!

- C
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

Welcome to the JavaRanch!

The details of how the server was put together are probably not important here, if you're seeing the original JSP text come back to the browser. What we need to determine is why the identity of the JSP isn't properly known.

First question is how you deployed said JSP. Are you set up as a proper J2EE webapp with the JSP in a WAR?


Customer surveys are for companies who didn't pay proper attention to begin with.
C Harrison
Greenhorn

Joined: Aug 16, 2011
Posts: 3
Hi,

Thanks for the quick response. I am just loading the jsp file manually through apache by using jkmount.

- C
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

All jmount does is redirect your URL to the Tomcat server. Apache httpd only routes the traffic and doesn't actually process the JSP in any way.

So the question remains: Did you create a WAR and deploy it in the Tomcat server?
C Harrison
Greenhorn

Joined: Aug 16, 2011
Posts: 3
No, I did not.

- C
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

C Harrison wrote:No, I did not.

- C


Do so, then.

J2EE is not quite as slapdash as ASP where you can just throw a page at the server and it runs. There are certain architectural requirements for J2EE web applications. On the other hand, there's a reason why ASP is J2EE is one of the preferred platforms for industrial-strength webapps.
 
Don't get me started about those stupid light bulbs.
 
subject: JSP configuration issues (displays code)
 
Similar Threads
Editing the bashrc file
Launching tomcat with jsvc
Installing mysql on Linux
ActionServlet compilation error
startup.sh