Advantages of JSP

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

 This is the most important technology in real time.

 Presentation purpose industry people used by this JSP.


 By using JSP we can develop the dynamic web pages.
 Whenever we are using the servlet technology there is a some drawbacks.
o Whenever we are developing the servlet must and should we have to configure inside the
web.xml file.(if 100 servelets are we must configure those 100 servlets this is burdon on
developer)
o Whenever we are modifying the servlet must and should we need to stop the server and we
need to compile the servlet and once again redeploy the application inside the sever and
restart the server. this is unnecessarily time consuming process.
o Servlets are allowed by the only java code but not text and html code.
o Presenting the data is very slow.
 To overcome the above problems we will go to the JSP.
Advantages of JSP
1. whenever we are developing the JSP page we no need to configure inside the web.xml file.
2. Presenting the data is very fast compare to servlets.
3. Whenever we are modifying the JSP we no need to stop t-he server and restart the server.
4. Whenever we can make any changes on code no need to recompile the program.
5. The JSP pages is allowed by the html code, textual data and java code.
Rules of JSP
 Whenever we are developing jsp page must and should we need to save with .jsp extension.
 After developing the jsp page must and should we need to place inside the application scope(root
folder)
JSP scripting elements(3 types)
 By using this we can write the java code inside the JSP without this we can’t write the java code inside
the JSP page but we can provide the html data and textual data without using this JSP elements.

1. Scripting elements
a. declarative element-------------declare variables and methods
b. scriptlet elements---------------business logic
c. expression element--------------print message
2. directives
a. page directive
b. include directive
c. taglib directive
3. jsp action tags
a. jsp predefined action tags
i. forward action tag
ii. include action tag
iii. param action tag
iv. usebead action tag
v. setproperty action tag
vi. getproperty action tag…………………..etc
b. custom tags---------user defined tags
1.declarative element
 using this we can declare the instance variables and instance methods
syntax
<%!
declare the instance variables and methods
%>
2.scriptlet element
 by using this we can write the business logic.
syntax
<%
Implementing the business logic
%>
3.expression element
 by using this we can print the results. (after processing the business logic we get the results)
syntax
<%=
Expression
%>

Jsp client application

Communication jsp with html


Add.jsp

</center>
</html>

Implicit objects in JSP


JSP life cycle methods
1. jspInit()
2. jspDestroy()
3. _jspService()

You might also like