You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Cavanagh <ca...@con-sense-group.com> on 2011/09/03 22:01:54 UTC

Tomcat 7.0.16 won't execute my JSP pages

Hello Tomcat users.

I have been a happy Tomcat user since Tomcat 4.x, this will be my first 
post in a long time.

We updated from Tomcat 6.x to Tomcat 7.0.4 a few months ago.  This 
worked just fine.
When I updated to Tomcat 7.0.20 last week, I discovered that our JSP 
pages aren't being executed , rather the server sends back our JSP code 
to the user.  That is not really the desired effect.
After some testing, I discovered that this problem was first introduced 
with Tomcat 7.0.16.  Everything works fine in Tomcat 7.0.14.  There is 
no error being logged by Tomcat.

Our Application is programmed, built and compiled in Netbeans.  It is 
distributed via a WAR file.
The only "special" parts of our web.xml relating to JSP, are that we 
execute jnlp files using the JSP engine (we have dynamic java web start 
files).
/<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jnlp</url-pattern>
</servlet-mapping>/

There is no error message.
I can see the hits in the localhost_access_log


In the root directory, the index.jsp is executing correctly!


Actually I managed to solve the problem by adding a servlet mapping for jsp.
/
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jnlp</url-pattern>
</servlet-mapping>/
/<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>

/Interestingly this problem doesn't occur, when both of these sevlet 
mappings are deleted.
It seems that Tomcat up to 7.0.16 always had a default mapping for *.jsp 
and that from Tomcat 7.0.16 this default mapping only exists, if there 
are no other jsp mappings.
In my case I need both mappings, to ensure that both *.jsp and *.jnlp 
files are executed as jsp.
I haven't tried to find the code that changed, it doesn't really bother 
me having one more mapping in my web.xml#

So maybe this will help some other Tomcat user.

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org