If you are unfamiliar with Java programming, you may want to take a look at Sun's guidelines. However, web creators do not need to do much Java development. In addition to some method calls, you should use as little Java code as possible in your JSP pages.
With these tips in mind, let's take a look at the JSP directives and the scripting elements, and then we'll explain JavaBeans and suppressed objects. There are five kinds of JSP directives and script elements. In JSP version 1.0, most JSPs are surrounded by a tag that starts with "<%" and ends with "%>." After the updated JSP 1.1 specification was introduced, there was an XML-compatible version.
JSP directives and script elements
Directives < %@ directive %>
Declarations < %! declaration %>
Expressions < %= expression %>
Code Fragment/Scriptlet < % code fragment %>
Comments < %-- comment --%>
Instructions
JSP directives are designed for the JSP engine. They don't directly produce any visible output, but just tell the engine how to handle the rest of the JSP pages. These directives are always enclosed in the "<%@?%>" tag. The two most important directives are "pagepage" and "Include". The "Taglib" directive is not in the discussion column, but it can be used to create a custom tag with JSP1.1.
"Page" instructions are seen almost at the top of all JSP pages. Although not necessary, it allows you to specify:
Where to find the supported Java categories:
<%@ page import= "Java.util.Date"%>
Where to turn on the Web surfers when there is a Java run problem:
<%@ page errorpage= "errorpage.jsp"%>
and whether you need to manage the user's session-level information, which may come from multiple pages (further in the JavaBeans section below):