'Back-End/Jsp'에 해당되는 글 14건

[Jsp] JSP API

Back-End/Jsp 2016. 7. 5. 14:48
donaricano-btn

JSP API

- javax.servlet.jsp

- javax.servlet.jsp.tagext


1. javax.servlet.jsp

The javax.servlet.jsp package has two interface and classes

- JspPage

- HttpJspPage


1_1. JspPage interface

- All the generated servlet classes must implement the JspPage interface

- It extends the Servlet interface, It provides two life cycle methods

* Mehtods of JspPage interface

1) public void jspInit()

- It is invoked only once during the life cycle of the JSP when JSP page is requested firstly.

- It is used to perform initializationi. It is same as the init() method of Servlet


2) public void jspDestroy()

- It is invoked only once during the life cycle of the JSP before the JSP page is destroyed


1_2. The HttpJspPage interface

- The HttpJspPage interface provides the one life cycle method of JSP.

- It extends the JspPage interface


* Method of HttpJspPage interface

1) public void _jspService()

- It is invoked each time when request for the JSP page comes to the container.

- It is used to process the request. 

- The underscore _ signifies that you cannot override this method






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

[Jsp] Page directives  (0) 2016.07.06
[Jsp] Implicit Object_2  (0) 2016.07.06
[Jsp] Implicit Objects_1  (0) 2016.07.05
[Jsp] JSP tags  (0) 2016.07.05
[Jsp] Cycle of Jsp  (0) 2016.07.04
블로그 이미지

리딩리드

,

[Jsp] Cycle of Jsp

Back-End/Jsp 2016. 7. 4. 18:11
donaricano-btn

Cycle of Jsp


1. Jsp

- Jsp technology is used to create web application just like Servlet technology. It can be thought of as an extension to servlet because it provides more functionality than servlet such as expression language, jstl...


2. Advantage of JSP over Servlet


2_1. Extension to servlet

- JSP technology is the extension to servlet technology. We can use all the feature of servlet in JSP

- We can use implicit objects, predefined tags, expression language and Custom tags in JSP


2_2. Easy to maintain

- JSP can be easily managed because we can easily separate our business logic with presentation logic


2_3. Fast Development: No need to recompile and redeploy

- If JSP page is modified, we don't need to recompile and redeploy the project.


2_4. Less code than Servlet

- In JSP, we can use a lot of tags such as action tags, jstl, custom tags etc. that reduces the code


3. Life cycle of a JSP Page

        • Translation of JSP Page
        • Compilation of JSP Page
        • Classloading(class file is loaded by the classloader)
        • Instantiation(object of the Generated Servlet is created)
        • Initialization(jspinit() method is invoked by the container)
        • Request processing( _jspService() method is invoked by the container)
        • Destroy (jspDestroy() method is invoked by the contaier)


1) JSP page is translated into servlet by the help of JSP Translator

- JSP Translator is a part of webserver


2) Servlet page is compiled by the compiler and gets converted into the class file

3) All the processes that happens in servlet is performed on JSP later like initailization, committing response to the browser and destroy


4. Directory structure of JSP

The directory structure of JSP page is same as servlet.



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

[Jsp] Page directives  (0) 2016.07.06
[Jsp] Implicit Object_2  (0) 2016.07.06
[Jsp] Implicit Objects_1  (0) 2016.07.05
[Jsp] JSP tags  (0) 2016.07.05
[Jsp] JSP API  (0) 2016.07.05
블로그 이미지

리딩리드

,