Tuesday, 19 June 2007

JSP and JSP Fragment

I was kind of shock to find out that there's something call JSP fragment which can be added into JSP pages (more shocking to know that I've been so blind!!! : O). Embedding "fragments" in JSP is not the same as embedding another JSP page (which I know about!!! : P).

So here are the explanations!!!

JSP:
A JSP page is a text document that contains two types of text:
  • Static data - which can be expressed in any text-based format (usually HTML).
  • Dynamic content - Constructed using JSP elements
The page can consist of one or more files. It may include other files that contain either a complete JSP page or a fragment of a JSP page.

Embedding the whole JSP page:
For embedding source files of complete JSP pages, the files should use the extension, .jsp.

Embedding the JSP fragment:
For embedding incomplete JSP segments, the files should use the extension, .jspf. (It needs not to be legal JSP pages and thus may not compile properly).

References:
http://en.allexperts.com/q/JSP-Java-Server-3299/difference-jsp-jspf-files.htm
http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.developer.doc/refs/rsdjspbpjspf.htm
http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention

No comments:

Post a Comment