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 |