JSP Articles

Page 5 of 8

What is a pageContext Object in JSP?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 1K+ Views

The pageContext object is an instance of a javax.servlet.jsp.PageContext object. The pageContext object is used to represent the entire JSP page.This object is intended as a means to access information about the page while avoiding most of the implementation details.This object stores references to the request and response objects for each request. The application, config, session, and out objects are derived by accessing attributes of this object.The pageContext object also contains information about the directives issued to the JSP page, including the buffering information, the errorPageURL, and page scope.The PageContext class defines several fields, including PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, and APPLICATION_SCOPE, ...

Read More

What the different types of JSTL tags are ?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 701 Views

The JSTL tags can be classified, according to their functions, into the following JSTL tag library groups that can be used when creating a JSP page −Core TagsFormatting tagsSQL tagsXML tagsJSTL Functions

Read More

What is the use of page object in JSP? Need an example.

George John
George John
Updated on 30-Jul-2019 245 Views

JSP gives you an option to specify Error Page for each JSP using page attribute. Whenever the page throws an exception, the JSP container automatically invokes the error page.Following is an example to specifiy an error page for a main.jsp. To set up an error page, use the directive.                 Error Handling Example               We will now write one Error Handling JSP ShowError.jsp, which is given below. Notice that the error-handling page includes the directive . This directive causes ...

Read More

How to create a common error page using JSP?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 2K+ Views

JSP gives you an option to specify Error Page for each JSP using page attribute. Whenever the page throws an exception, the JSP container automatically invokes the error page.Following is an example to specifiy an error page for a main.jsp. To set up an error page, use the directive.           Error Handling Example               We will now write one Error Handling JSP ShowError.jsp, which is given below. Notice that the error-handling page includes the directive . This directive causes the JSP compiler ...

Read More

How to handle error object in JSP using JSTL tags?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 646 Views

You can make use of JSTL tags to write an error page ShowError.jsp with better structure and more information −           Show Error Page               Opps...                             Error:             ${pageContext.exception}                                 URI:             ${pageContext.errorData.requestURI}                             ...

Read More

What is a buffer attribute in JSP?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 1K+ Views

The buffer attribute specifies the buffering characteristics for the server output response object.You may code a value of "none" to specify no buffering so that the servlet output is immediately directed to the response object or you may code a maximum buffer size in kilobytes, which directs the servlet to write to the buffer before writing to the response object.To direct the servlet to write the output directly to the response output object, use the following −Use the following to direct the servlet to write the output to a buffer of size not less than 8 kilobytes −

Read More

What happens when buffer is set to a value "none" in JSP?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 256 Views

The buffer attribute specifies the buffering characteristics for the server output response object.You may code value of "none" to specify no buffering so that the servlet output is immediately directed to the response object or you may code a maximum buffer size in kilobytes, which directs the servlet to write to the buffer before writing to the response object.To direct the servlet to write the output directly to the response output object, use the following −

Read More

What is autoFlush attribute in JSP?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 2K+ Views

The autoFlush attribute specifies whether the buffered output should be flushed automatically when the buffer is filled, or whether an exception should be raised to indicate the buffer overflow.A value of true (default) indicates automatic buffer flushing and a value of false throws an exception.The following directive causes the servlet to throw an exception when the servlet's output buffer is full −This directive causes the servlet to flush the output buffer when full −Usually, the buffer and the autoFlush attributes are coded on a single page directive as follows −

Read More

What is contentType attribute in JSP?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 4K+ Views

The contentType attribute sets the character encoding for the JSP page and for the generated response page. The default content type is text/html, which is the standard content type for HTML pages.If you want to write out XML from your JSP, use the following page directive −The following statement directs the browser to render the generated page as HTML −The following directive sets the content type as a Microsoft Word document −You can also specify the character encoding for the response. For example, if you wanted to specify that the resulting page that is returned to the browser uses ISO ...

Read More

What is errorPage attribute in JSP?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 784 Views

The errorPage attribute tells the JSP engine which page to display if there is an error while the current page runs. The value of the errorPage attribute is a relative URL.The following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown −The isErrorPage attribute indicates that the current JSP can be used as the error page for another JSP.The value of isErrorPage is either true or false. The default value of the isErrorPage attribute is false.For example, handleError.jsp sets the isErrorPage option to true because it is supposed to handle errors −

Read More
Showing 41–50 of 77 articles
« Prev 1 3 4 5 6 7 8 Next »
Advertisements