Using fragments combined with jspx (xml compliant jsp) is problematic. Standard jspf pieces stored in WEB-INF/jspfs can't use any elements not allowed in standard jspf or the application server will complain about those elements not being allowed (even when using <jsp:directive.include file="blah" />, which isn't supposed to pre-parse the file). If you set is-xml to true for jspfs in the web.xml, it fixes that error, but of course as it's a fragment and not a real xml file, it errors out saying such.
Workarounds include:
- keeping your fragments to jspf parsable elements
- building fully pre-parsable pieces that output the needed elements and using <jsp:include page="blah" /> (doesn't work if you want to do things like bean or variable declarations to communicate across elements)
- using another parsing engine and forget about fragments, like struts tiles (if using struts) or SiteMesh