Ryan said:
From "Code Conventions for the JavaServer Pages Technology Version 1.x
Language":
"Third, we use the term JSP fragment to refer to a JSP page that can be
included in another JSP page. ... JSP fragments can use either .jsp or .jspf
as a suffix, and should be placed either in /WEB-INF/jspf or with the rest
of the static content, respectively. JSP fragments that are not complete
pages should always use the .jspf suffix and should always be placed in
/WEB-INF/jspf."
http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention/
I think "JSP fragments can use either .jsp or .jspf as a suffix, and
should be placed either in /WEB-INF/jspf or with the rest of the static
content, respectively" mixes up the recommended locations for .jsp and
..jspf files. In particular, it is not consistent with the next sentence
that specifies that certain JSP fragments should both have the .jspf
extension and be located in /WEB-INF/jspf. As a result, I think the
convention that is being conveyed is to put .jsp files "with [...] the
static content", i.e. _not_ under WEB-INF.
Granted it can be interpreted a couple of ways.
Indeed. You can certainly disagree with my interpretation, but in
stipulating multiple possible interpretations you absolve the text in
question from having any authority with respect to the matter at hand.
When using Struts, the idea
is that all access to the application will go through Struts. Therefore,
there is no need for any public JSPs. And in a sense, every JSP is being
included, though not in another JSP.
That's well and good, but not relevant to where the .jsp files should be
located relative to the webapp root. I happen to agree with Alan that
JSPs that are complete pages and are used as such should not be placed
under WEB-INF. There are multiple mechanisms available for preventing
direct access to the JSPs; putting them under WEB-INF is unnecessary,
unconventional (according to my reading of the Sun convention), and
confusing.
John Bollinger
(e-mail address removed)