JSP displaying source code instead of executing

Posted by DJStroky on Stack Overflow See other posts from Stack Overflow or by DJStroky
Published on 2011-01-15T02:45:48Z Indexed on 2011/01/15 2:53 UTC
Read the original article Hit count: 177

Filed under:
|
|

I'm new to jsp and have ran into some trouble. Initially, the jsp file and associated java classes were built and tested fine on a test Tomcat server. Now, they've been transitioned to another server of what I believe is the same setup (except it's linux now instead of windows). But when the jsp page is accessed the source code is displayed instead of the jsp actually executing. I've googled for a while but received no success.

I had thought that this page might solve the problem since there was no reference to the jsp file I was using or even the following snippets in my web.xml file in the WEB-INF folder:

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>logVerbosityLevel</param-name>
        <param-value>WARNING</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
</servlet-mapping>

I tried inserting these lines and restarting Tomcat, but no success. Any ideas?

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp