Java Training: – Explain Page directives?

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

java
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

Regards,

Get more Java training stuffs from author’s blog

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s