- This topic has 4 replies, 3 voices, and was last updated 20 years, 4 months ago by sababrent.
-
AuthorPosts
-
Michael DicksonMemberI’m working with sources supplied by a third party where a couple files failed to compile because they where fragments. I found a message previously the recommended renaming to “*.jsf” and mentioned this was required by the JSP spec. I can’t find it in the relevant JSP specs. Can someone please point me to the spec that specifies that fragments should have a suffix of “*.jsf”!? I’d like to get the original project team to use this convention so I have an easier time when taking code releases integrating it into myEclipse.
Mike
Scott AndersonParticipantMike,
Actually, the suffix is “.jspf”, and it’s a recommendation in the spec, not an absolute requirement. Here’s the relevant passage from the JSP 2.0 spec:
PROPOSED FINAL DRAFT 3
By default the extension .jsp means a top-level JSP file. We recommend, but do not mandate, to differentiate between top-level JSP files (invoked directly by the client or dynamically included by another page or servlet) and statically included segments so that:• The .jsp extension is used only for files corresponding to top level JSP files, forming a JSP page when processed.
• Statically included segments use any other extension. As included segments were called ‘JSP fragments’ in past versions of this specification, the extension .jspf was offered as a suggestion. This extension is still suggested for consistency reasons, despite that they are now called ‘jsp segments’.As you can see, you can really have make your fragments have any extention you want, just not .jsp. Using .jspf is just a recommendation, but any non-.jsp extension will work.
Please proceed by printing the entire JSP 2.0 specification, rolling it into a tight tube, and smacking the original project team abruptly on the nose with it, while saying “bad team, bad team”. 😉
–Scott
MyEclipse Support
Michael DicksonMemberOk, Thanks Scott. So then, this is just a small nit but, ideally the JSP compiler should do something sensible with compilation of jsp fragments in .jsp files. As it stands they are flagged as fatal errors. Consider this a low priority suggestion for a future release.
And I do agree it would have been easier to simply mandate the convention and be done with it…
Again thanks for your excellent support.
— Mike
Scott AndersonParticipantMike,
ideally the JSP compiler should do something sensible with compilation of jsp fragments in .jsp files
And it does; it ignores them. Of course, this is contingent on being able to identify the file as a fragment. 🙂 If a file has a .jsp extension, it’s assumed to be a top-level JSP, as mandated by the spec. The spec is very clear that .jsp is only for top level files. It’s flexible on what the suffix is on non-toplevel files. To work around the problem, you can turn JSP compilation off (in version 2.5.1) on the JSP editor’s syntax page until you can get your suffixes into compliance.
Again thanks for your excellent support.
Not a problem. That’s what we’re here for.
–Scott
MyEclipse Support
sababrentMemberIs it possible to have these files, with alternate file extensions, still show the colorized code that appears for standard JSPs? I am running Eclipse 3 on Win2k.
-
AuthorPosts