Monday 25 June 2012

Java Training: - Elaborate Page directives?

Page directive is used to define page attributes the JSP file. Below is a sample of the same:-

To summarize some of the important page attributes:-

Import: - Comma separated list of packages or classes, just like import statements in usual Java code.

Session: - Specifies whether this page can use HTTP session. If set "true" session (which refers to the javax.servlet.http.HttpSession) is available and can be used to access the current/new session for the page.

If "false", the page does not participate in a session and the implicit session object is unavailable.

buffer :- If a buffer size is specified (such as "50kb") then output is buffered with a buffer size not less than that value.

isThreadSafe :- Defines the level of thread safety implemented in the page. If set "true" the JSP engine may send multiple client requests to the page at the same time. If "false" then the JSP engine queues up client requests sent to the page for processing, and processes them one request at a time, in the order they were received. This is the same as implementing the javax.servlet.SingleThreadModel interface in a servlet.

errorPage: - Defines a URL to another JSP page, which is invoked if an unchecked runtime exception is thrown. The page implementation catches the instance of the Throwable object and passes it to the error page processing.

See the following video on overview Service Loader in Java: -

Click to get Java Training


Get more Java training stuffs from author's blog

No comments:

Post a Comment