donaricano-btn

Page directives

- The jsp directives are messages that tells the web container how to translate a JSP page into the corresponding servlet


1. Syntax

<%@ directive attribute="value" %>


2. page directive

- The page directive defines attributes that apply to an entire JSP page


2_1. Syntax

<%@ page attribute="value" %>


2_2. Attributes

          • import
          • contentType
          • extends
          • info
          • buffer
          • language
          • isELIgnored
          • isThreadSafe
          • autoFlush
          • session
          • pageEncoding
          • errorPage
          • isErrorPage


2_3. How to use

1) import

- It is used to import class, interface or all the members of a package

- It is similar to import keyword in java class 


Example


2) contentType

- The contentType attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response

- Default value is "text/html; charset-ISO-8859-1"


Example

- When I reload the welcome.jsp page, welcome.jsp page is downloaded


3) buffer

- The buffer attribute sets the buffer size in kilobytes to handle output generated by the JSP page

- The default size of the buffer is 8Kb


Example


4) isELIgnored

 - We can ignore the Expression Language(EL) in jsp by the isELIgnored attribute

- By default its value is false i.e. Expression Language is enabled by default


Example


5) errorPage

- The errorPage attribute is used to define the error page, if exception occurs in the current page, it will be redirected to the error page


Example


6) isErrorPage

- This attribute is used to declare that the current page is the error page


Example


'Back-End > Jsp' 카테고리의 다른 글

[Jsp] Exception  (0) 2016.07.07
[Jsp] Include & taglib directive  (0) 2016.07.07
[Jsp] Implicit Object_2  (0) 2016.07.06
[Jsp] Implicit Objects_1  (0) 2016.07.05
[Jsp] JSP tags  (0) 2016.07.05
블로그 이미지

리딩리드

,