SlideShare una empresa de Scribd logo
1 de 9
Java Server Pages JSP, JSTL, and Servlets
Topics What is JSP What is JSTL What is a Servlet? What are Beans? JSP Access Models Benefits and Shortcomings Samples Questions / Comments
What is JSP? JavaServer Pages enable Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems. JSP technology enables development of Web-based applications that are platform independent. JSP technology separates the user interface from content generation, enabling designers to easily change the overall page layout without altering the underlying dynamic content.
What is JSTL? The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many web applications. single, standard set of tags. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. Examples: 1: <c:forEach var="item“ items="${sessionScope.cart.items}">  	<tr><td> 		<c:out value=“${item.name}”></td> 		<td><c:out value=“${item.price}”> 	</td></tr> </c:forEach> 2: <c:choose>    <c:when test='${param.responseText == “Fail"}'>		<b>There was an error!</b>    </c:when> 	<c:otherwise> 		Everything is great! 	</c:otherwise>  </c:choose>
What is a Servlet? Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems A servlet can almost be thought of as an applet that runs on the server side--without a face.  Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection. Servlet: package silenceit;public class Hello{  public String show(){    return ”Hello”;  }} JSP Page: <%@page import=“silenceit.hello" %> <html>   <head>     <title>        Example of page Directive in JSP     </title>   </head>   <body>     <%        Hello he = new Hello(); out.print(he.show());      %>   </body> </html>
What are Beans? Java Beans are reusable components. They are used to separate Business logic from the Presentation logic. Internally, a bean is just an instance of a class with special naming conventions and characteristics. Bean Conventions: In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans. The class must have a public default constructor. This allows easy instantiation within editing and activation frameworks. The class properties must be accessible using get, set, and other methods (so-called accessor methods and mutator methods), following a standard naming convention. This allows easy automated inspection and updating of bean state within frameworks, many of which include custom editors for various types of properties. The class should be serializable. This allows applications and frameworks to reliably save, store, and restore the bean's state in a fashion that is independent of the VM and platform. Example Bean: publicclassPersonBeanimplementsjava.io.Serializable {    private String name;    privateboolean deceased;     /** No-arg constructor*/    publicPersonBean() {    }     /** * Property */    public String getName() { returnthis.name;    }     /** * Setter for property Name */ publicvoidsetName(final String name) {       this.name = name;    }   /** * Getter for property "deceased" * Different syntax for a boolean field (is vs. get) */    publicbooleanisDeceased() {       returnthis.deceased;    }    /** * Setter for property deceased */ publicvoidsetDeceased(finalboolean deceased) {      this.deceased = deceased;    } }
JSP Access Models The early JSP specifications advocated two philosophical approaches, popularly known as Model 1 and Model 2 architectures, for applying JSP technology. These approaches differ essentially in the location at which the bulk of the request processing is performed Model 1 Model 2 The Model 2 architecture, shown above, is a server-side implementation of the popular Model/View/Controller design pattern. Here, the processing is divided between presentation and front components. Presentation components are JSP pages that generate the HTML/XML response that determines the user interface when rendered by the browser. Front components (also known as controllers) do not handle any presentation issues, but rather, process all the HTTP requests Although the Model 1 architecture is suitable for simple applications, it may not be desirable for complex implementations. Indiscriminate usage of this architecture usually leads to a significant amount of scriptlets or Java code embedded within the JSP page
Benefits and Shortcomings JSP Benefits: Platform and Server Independence Open Development Process, Open Source Extensible JSP Tags Application persistence and variable scopes Mature Java language Easier Maintenance Scripting languages are fine for small applications, but do not scale well to manage large, complex applications. Because the Java language is structured, it is easier to build and maintain large, modular applications with it. JSP technology's emphasis on components over scripting makes it easier to revise content without affecting logic, or revise logic without changing content. The Enterprise JavaBeans architecture encapsulates the enterprise logic, such as database access, security, and transaction integrity, and isolates it from the application itself. Because JSP technology is an open, cross-platform architecture, Web servers, platforms, and other components can be easily upgraded or switched without affecting JSP-based applications. This makes JSP suitable for real-world Web applications, where constant change and growth is the norm. Security Since JSP can interoperate with standard Java it has access to the underlying Java SE Platforms extensible security architecture . Security features — cryptography, authentication and authorization, public key infrastructure, and more. JSP Shortcomings: ,[object Object]
JSP Typically issues poor error reports

Más contenido relacionado

La actualidad más candente

JSP Processing
JSP ProcessingJSP Processing
JSP Processing
Sadhana28
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
1.jsp application models
1.jsp application models1.jsp application models
1.jsp application models
web360
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
Atit Patumvan
 

La actualidad más candente (20)

JSP Processing
JSP ProcessingJSP Processing
JSP Processing
 
Jsf2 overview
Jsf2 overviewJsf2 overview
Jsf2 overview
 
Jsp
JspJsp
Jsp
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Jsf+ejb 50
Jsf+ejb 50Jsf+ejb 50
Jsf+ejb 50
 
Java server pages
Java server pagesJava server pages
Java server pages
 
1.jsp application models
1.jsp application models1.jsp application models
1.jsp application models
 
Java J2EE
Java J2EEJava J2EE
Java J2EE
 
Java Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web ApplicationJava Web Programming [1/9] : Introduction to Web Application
Java Web Programming [1/9] : Introduction to Web Application
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
 
JSP Technology I
JSP Technology IJSP Technology I
JSP Technology I
 
Jspx Jdc2010
Jspx Jdc2010Jspx Jdc2010
Jspx Jdc2010
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)Unit 07: Design Patterns and Frameworks (3/3)
Unit 07: Design Patterns and Frameworks (3/3)
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
Entity beans in java
Entity beans in javaEntity beans in java
Entity beans in java
 
OpenESB
OpenESBOpenESB
OpenESB
 
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
JSR 236 Concurrency Utils for EE presentation for JavaOne 2013 (CON7948)
 
Lecture 8 Enterprise Java Beans (EJB)
Lecture 8  Enterprise Java Beans (EJB)Lecture 8  Enterprise Java Beans (EJB)
Lecture 8 Enterprise Java Beans (EJB)
 
Jdbc drivers
Jdbc driversJdbc drivers
Jdbc drivers
 

Destacado

Square meter investigation new
Square meter investigation newSquare meter investigation new
Square meter investigation new
grade4biss
 
Diapsitivas vicente
Diapsitivas vicenteDiapsitivas vicente
Diapsitivas vicente
jose1707
 
NEW RESUME_F_2016_ERVIN
NEW RESUME_F_2016_ERVINNEW RESUME_F_2016_ERVIN
NEW RESUME_F_2016_ERVIN
Keondae Ervin
 

Destacado (20)

Presentation
PresentationPresentation
Presentation
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
Agropecuaria
AgropecuariaAgropecuaria
Agropecuaria
 
Eco eko - listado de ingredientes peligrosos en cosmética
Eco eko - listado de ingredientes peligrosos en cosméticaEco eko - listado de ingredientes peligrosos en cosmética
Eco eko - listado de ingredientes peligrosos en cosmética
 
Square meter investigation new
Square meter investigation newSquare meter investigation new
Square meter investigation new
 
Resume
ResumeResume
Resume
 
Agenda 15
Agenda  15Agenda  15
Agenda 15
 
Agenda 25
Agenda 25Agenda 25
Agenda 25
 
2015 Fall Conference: ISOSWO Lightning Round-Terracon
2015 Fall Conference: ISOSWO Lightning Round-Terracon2015 Fall Conference: ISOSWO Lightning Round-Terracon
2015 Fall Conference: ISOSWO Lightning Round-Terracon
 
Diapsitivas vicente
Diapsitivas vicenteDiapsitivas vicente
Diapsitivas vicente
 
2015 Fall Conference: Public Meeting, Admin and HR-Brick
2015 Fall Conference: Public Meeting, Admin and HR-Brick2015 Fall Conference: Public Meeting, Admin and HR-Brick
2015 Fall Conference: Public Meeting, Admin and HR-Brick
 
CWP, Dr Ravi
CWP, Dr RaviCWP, Dr Ravi
CWP, Dr Ravi
 
Projeto Prioritário
Projeto PrioritárioProjeto Prioritário
Projeto Prioritário
 
Znaky a symboly
Znaky a symbolyZnaky a symboly
Znaky a symboly
 
TREBALL_aRt
TREBALL_aRtTREBALL_aRt
TREBALL_aRt
 
NEW RESUME_F_2016_ERVIN
NEW RESUME_F_2016_ERVINNEW RESUME_F_2016_ERVIN
NEW RESUME_F_2016_ERVIN
 
2015 Fall Conference: Closed Loop Fund Essentials
2015 Fall Conference: Closed Loop Fund Essentials2015 Fall Conference: Closed Loop Fund Essentials
2015 Fall Conference: Closed Loop Fund Essentials
 
Zethofer Efraim 2015 heb-en
Zethofer Efraim 2015   heb-enZethofer Efraim 2015   heb-en
Zethofer Efraim 2015 heb-en
 
2015 Fall Conference: Avian Influenza-USDA
2015 Fall Conference: Avian Influenza-USDA2015 Fall Conference: Avian Influenza-USDA
2015 Fall Conference: Avian Influenza-USDA
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
 

Similar a JavaServer Pages

Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
Long Nguyen
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Comparative Display Technologies
Comparative Display TechnologiesComparative Display Technologies
Comparative Display Technologies
jiali zhang
 
Csajsp Chapter10
Csajsp Chapter10Csajsp Chapter10
Csajsp Chapter10
Adil Jafri
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
WebStackAcademy
 

Similar a JavaServer Pages (20)

Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern Approach
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Spatial approximate string search Doc
Spatial approximate string search DocSpatial approximate string search Doc
Spatial approximate string search Doc
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
 
JEE5 New Features
JEE5 New FeaturesJEE5 New Features
JEE5 New Features
 
Java part 3
Java part  3Java part  3
Java part 3
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Jsf2 overview
Jsf2 overviewJsf2 overview
Jsf2 overview
 
J2 Ee Overview
J2 Ee OverviewJ2 Ee Overview
J2 Ee Overview
 
Comparative Display Technologies
Comparative Display TechnologiesComparative Display Technologies
Comparative Display Technologies
 
PPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to serverPPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to server
 
Csajsp Chapter10
Csajsp Chapter10Csajsp Chapter10
Csajsp Chapter10
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
 

Más de silenceIT Inc.

Más de silenceIT Inc. (10)

PHP6 and HTML5
PHP6 and HTML5PHP6 and HTML5
PHP6 and HTML5
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Google Gears
Google GearsGoogle Gears
Google Gears
 
Prototype Seminar
Prototype SeminarPrototype Seminar
Prototype Seminar
 
PHP-IDS
PHP-IDSPHP-IDS
PHP-IDS
 
Bing Webmaster
Bing WebmasterBing Webmaster
Bing Webmaster
 
Joomla-Content Management System
Joomla-Content Management SystemJoomla-Content Management System
Joomla-Content Management System
 
JavaScript Leaks
JavaScript LeaksJavaScript Leaks
JavaScript Leaks
 
JeOS "Juice"
JeOS "Juice"JeOS "Juice"
JeOS "Juice"
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

JavaServer Pages

  • 1. Java Server Pages JSP, JSTL, and Servlets
  • 2. Topics What is JSP What is JSTL What is a Servlet? What are Beans? JSP Access Models Benefits and Shortcomings Samples Questions / Comments
  • 3. What is JSP? JavaServer Pages enable Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems. JSP technology enables development of Web-based applications that are platform independent. JSP technology separates the user interface from content generation, enabling designers to easily change the overall page layout without altering the underlying dynamic content.
  • 4. What is JSTL? The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many web applications. single, standard set of tags. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. Examples: 1: <c:forEach var="item“ items="${sessionScope.cart.items}"> <tr><td> <c:out value=“${item.name}”></td> <td><c:out value=“${item.price}”> </td></tr> </c:forEach> 2: <c:choose> <c:when test='${param.responseText == “Fail"}'> <b>There was an error!</b> </c:when> <c:otherwise> Everything is great! </c:otherwise> </c:choose>
  • 5. What is a Servlet? Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems A servlet can almost be thought of as an applet that runs on the server side--without a face. Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases. Servlets can also access a library of HTTP-specific calls and receive all the benefits of the mature Java language, including portability, performance, reusability, and crash protection. Servlet: package silenceit;public class Hello{  public String show(){    return ”Hello”;  }} JSP Page: <%@page import=“silenceit.hello" %> <html> <head> <title> Example of page Directive in JSP </title> </head> <body> <% Hello he = new Hello(); out.print(he.show()); %> </body> </html>
  • 6. What are Beans? Java Beans are reusable components. They are used to separate Business logic from the Presentation logic. Internally, a bean is just an instance of a class with special naming conventions and characteristics. Bean Conventions: In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans. The class must have a public default constructor. This allows easy instantiation within editing and activation frameworks. The class properties must be accessible using get, set, and other methods (so-called accessor methods and mutator methods), following a standard naming convention. This allows easy automated inspection and updating of bean state within frameworks, many of which include custom editors for various types of properties. The class should be serializable. This allows applications and frameworks to reliably save, store, and restore the bean's state in a fashion that is independent of the VM and platform. Example Bean: publicclassPersonBeanimplementsjava.io.Serializable { private String name; privateboolean deceased; /** No-arg constructor*/ publicPersonBean() { } /** * Property */ public String getName() { returnthis.name; } /** * Setter for property Name */ publicvoidsetName(final String name) { this.name = name; } /** * Getter for property "deceased" * Different syntax for a boolean field (is vs. get) */ publicbooleanisDeceased() { returnthis.deceased; } /** * Setter for property deceased */ publicvoidsetDeceased(finalboolean deceased) { this.deceased = deceased; } }
  • 7. JSP Access Models The early JSP specifications advocated two philosophical approaches, popularly known as Model 1 and Model 2 architectures, for applying JSP technology. These approaches differ essentially in the location at which the bulk of the request processing is performed Model 1 Model 2 The Model 2 architecture, shown above, is a server-side implementation of the popular Model/View/Controller design pattern. Here, the processing is divided between presentation and front components. Presentation components are JSP pages that generate the HTML/XML response that determines the user interface when rendered by the browser. Front components (also known as controllers) do not handle any presentation issues, but rather, process all the HTTP requests Although the Model 1 architecture is suitable for simple applications, it may not be desirable for complex implementations. Indiscriminate usage of this architecture usually leads to a significant amount of scriptlets or Java code embedded within the JSP page
  • 8.
  • 9. JSP Typically issues poor error reports
  • 10. JSP Pages use more disk space then regular scripting languages
  • 11. Need a solid knowledge of Java
  • 12. Some simple tasks are more difficult to perform
  • 13. Coding standards need to be diligently adhered to
  • 14.