Jsp(java server pages)

11
PRESENTED BY: MOHD HUSAIN HABEEB R.NO. 1305010317 MCA 5 TH SEMESTER

Transcript of Jsp(java server pages)

Page 1: Jsp(java server pages)

PRESENTED BY:MOHD HUSAIN HABEEBR.NO. 1305010317MCA 5TH SEMESTER

Page 2: Jsp(java server pages)

Contents

• Introduction.• JSP Architecture.• JSP Execution Procedure.• JSP Life-cycle.• JSP Vs Servlets.• Advantages of JSP.• Disadvantages of JSP.• References.

Page 3: Jsp(java server pages)

Introduction :What is JSP?

• Java Server Pages or as is normally called JSP is a Java based technology that simplifies the developing of dynamic web sites.

• It is a technology developed by Sun Microsystems, back in 1999.

• JSP pages are HTML pages with embedded code that allows to access data from Java code running on the server.

• JSP contains an extension of .jsp• JSP is used for UI/Front end/display purpose.

Page 4: Jsp(java server pages)

JSP Architecture

• Java Server Pages are part of a 3-tier architecture. A server(generally referred to as application or web server) supports the Java Server Pages. This server will act as a mediator between the client browser and a database.

Page 5: Jsp(java server pages)

JSP Execution procedure

Page 6: Jsp(java server pages)

JSP Life-cycle

Page 7: Jsp(java server pages)

JSP VS SERVLETS

JSP ServletsJSP is a webpage scripting language that can generate dynamic content.

Servlets are Java programs that are already compiled which also creates dynamic web content.

JSP run slower compared to Servlet as it takes compilation time to convert into Java Servlets.

Servlets run faster compared to JSP.

It’s easier to code in JSP than in Java Servlets.

Its little much code to write here.

In MVC, jsp act as a view. In MVC, servlet act as a controller.

JSP are generally preferred when there is not much processing of data required.

servlets are best for use when there is more processing and manipulation involved.

Page 8: Jsp(java server pages)

Advantages of JSP

• User need not write HTML and JAVA code separately.• JSP can be used for both front end and for writing business

logic.• JSP is dynamic compilation, which means when a JSP is

modified, it need not be compiled and restarted in the web server. After the modification of JSP, refresh the browser, changes will be reflected.

• JSP is Efficient: Every request for a JSP is handled by a simple Java thread.

• JSP is Scalable: Easy integration with other backend services.

Page 9: Jsp(java server pages)

• As JSP pages are translated to servlets and compiled, it is difficult to trace errors occurred in JSP pages. 

• JSP pages require double the disk space to hold the JSP page. • JSP pages require more time when accessed for the first time

as they are to be compiled on the server.

Disadvantages of JSP

Page 10: Jsp(java server pages)

References:

• http://www.javabeat.net• http://www.vnrgroups.com/video-tutorials/

servlets• https://www.youtube.com/user/edurekaIN• http://www.withoutbook.com/

DifferenceBetweenSubjects.php?subId1=2&subId2=16&d=Difference%20between%20JSP%20and%20Servlets

Page 11: Jsp(java server pages)

.