'Back-End'에 해당되는 글 135건

donaricano-btn

Action Tags_1


- The action tags are used to control the flow between pages and to use Java Bean.

- The jsp:useBean, jsp:setProperty, jsp:getProperty tags are used for bean development


1. jsp:forward action tag

- The jsp:forward action tag is used to forward the request to another resource it may be jsp, html or another resource


1_1 without parameter


1_2. with parameter


2. jsp:include action tag

- The jsp:include action tag is used to include the content of another resource it may be jsp, html or servlet

- It is better for dynamic pages because there might be changes in future

Example   

1) index.jsp

2) process.jsp

3) result




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

[Jsp] Expression Language(EL) - JSP  (0) 2016.07.08
[Jsp] (2)Action Tags_useBean  (0) 2016.07.08
[Jsp] Exception  (0) 2016.07.07
[Jsp] Include & taglib directive  (0) 2016.07.07
[Jsp] Page directives  (0) 2016.07.06
블로그 이미지

리딩리드

,

[Jsp] Exception

Back-End/Jsp 2016. 7. 7. 16:56
donaricano-btn

Exception 

- In JSP, there are two ways to perform exception handling

1) By errorPage and isErrorPage attributes of page directive

2) By <error-page> element in web.xml file



1. By the elements of page directive


1_1. index.jsp


1_2. process.jsp


1_3. error.jsp


1_4. result

2. By specifying the error-page element in web.xml

- This approach is better because you don't need to specify the errorPage attribute in each jsp page

- In this case, either specify exception-type or error code with the location element


2_1. web.xml

- If you want to handle any exception

- If you want to handle the exception for a specific error code


2_2 . error.jsp

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

[Jsp] (2)Action Tags_useBean  (0) 2016.07.08
[Jsp] (1)Action Tags_forward&include  (0) 2016.07.07
[Jsp] Include & taglib directive  (0) 2016.07.07
[Jsp] Page directives  (0) 2016.07.06
[Jsp] Implicit Object_2  (0) 2016.07.06
블로그 이미지

리딩리드

,
donaricano-btn

Include & taglib directive


1. Include

- The include directive is used to include the contents of any resource it may be jsp file, html file or text file.


Example


2. Taglib

- The JSP taglib directive is used to define a tag library that defines many tags

- We can use the TLD(Tag Library Descriptor) file to define the tags


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

[Jsp] (1)Action Tags_forward&include  (0) 2016.07.07
[Jsp] Exception  (0) 2016.07.07
[Jsp] Page directives  (0) 2016.07.06
[Jsp] Implicit Object_2  (0) 2016.07.06
[Jsp] Implicit Objects_1  (0) 2016.07.05
블로그 이미지

리딩리드

,
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
블로그 이미지

리딩리드

,