Java Reference
In-Depth Information
Creating a JSP fragment in NetBeans
To create a JSP fragment in NetBeans, we simply need to go to
File | New File
, select
Web
as the category, then
JSP
as the file type. We then fill out all the information in
the
New JSP File
window as usual, making sure to check the
Create as JSP Segment
checkbox.
NetBeans suggests placing the JSP fragment under
WEB-INF/jspf
, the reason for
this is that any files under the
WEB-INF
folder are not directly accessible via the web
browser. Since JSP fragments are not full JSPs, most of the time they won't render
properly in a web browser by themselves, therefore it is a good idea to follow
NetBeans' suggestion.
NetBeans will automatically create the
WEB-INF/jspf
folder for us if it
doesn't already exist.
At this point, NetBeans generates our page with some trivial content meant to be
replaced with something else.