tags:

views:

904

answers:

2

I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in .jspx, or tomcat won't translate tag libraries and stuff.

Both file extensions map to the same servlet in tomcat's configuration file, so I thought everything was fine with my .jsp files. Am I missing something?

+2  A: 

There are additional configurations for servlets that can affect behavior. I haven't tried it, but would assume that you could just override some of the default configurations for *.jsp to use that of *.jspx.

Try adding a jsp-property-group definition for *.jsp with is-xml set to true:

<jsp-property-group>
  <url-pattern>*.jsp</url-pattern>
  <is-xml>true</is-xml>
</jsp-property-group>

Some information on configuring property groups.

Mads Hansen
+1  A: 

Not one to give up easily, I found this explanation in the Java5 EE Tutorial,

Although the jsp:root element is not required, it is still useful in these cases:

  • When you want to identify the document as a JSP document to the JSP container without having to add any configuration attributes to the deployment descriptor or name the document with a .jspx extension

So I guess I should have read the docs more carefully :-)

agnul