This document provides an overview of JavaServer Faces (JSF) and JavaServer Pages (JSP). It discusses the key differences between the two technologies, including that JSF is newer and handles non-functional requirements like navigation and validation, while JSP is older and leaves these to be coded manually. The document also covers the architecture and phases of JSF, common tags used in JSF and JSP, and provides an example JSF application to demonstrate basic usage.
The document discusses Java persistence and JPA 2. It introduces entity beans as persistent objects mapped to database tables. An entity bean represents data from a database table as a Java object. The document covers the lifecycle of entity beans, associations between entity beans like one-to-one and many-to-many relationships, and using the entity manager to persist, find, and remove entity beans from the database. It provides examples of entity bean classes annotated with JPA annotations and a persistence configuration file.
This document provides an overview of JSP (JavaServer Pages) basics. It discusses what JSP is, its advantages, the elements that make up a JSP file including directives, scripting elements, actions, and implicit objects. It also covers the JSP lifecycle, how JSP pages work, common directives like page and include, scripting elements like declarations, scriptlets and expressions, and standard actions like include, forward, useBean and setProperty. The document is intended to teach the fundamentals of JSP through explanations and examples.
This document introduces the Model-View-Controller (MVC) pattern and its evolution in web application design. It discusses the Model 1 architecture which is page-centric, and the Model 2 architecture which is servlet-centric. Model 2 architecture separates the application into three logical layers - the model, the view, and the controller. Web application frameworks like Struts are also introduced, which are based on MVC Model 2 architecture and provide common functionality to web applications.
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
The document discusses the history and evolution of Java EE and its specifications such as EJB and JSF. It introduces key concepts in Java EE 6 including Contexts and Dependency Injection (CDI), which provides a standard way to inject dependencies into Java objects without hardcoding them. CDI allows for loose coupling through contextual lifecycles and scopes, interceptors, and producers that control bean instantiation.
The document discusses new features in Oracle8i for administrators, including Java in the database, optimizer and query improvements, summary management, indexes and partitioning, universal installer migration and upgrade features, manageability features, availability and recoverability, Net8 features, SQL*Plus and national language support, database security, and partial additions. Key points covered include Java virtual machine integration, SQLJ and JDBC, using Java with Oracle, Java configuration, Internet file system, and stored outlines for optimizer plan stability.
This document provides an overview of Java Server Pages (JSP) technology. Some key points:
- JSP allows separation of work between web designers and developers by allowing HTML/CSS design and Java code to be placed in the same file.
- A JSP page is compiled into a servlet, so it can take advantage of servlet features like platform independence and database-driven applications.
- JSP pages use tags like <jsp:include> and <jsp:useBean> to include content and access JavaBeans. Scriptlets, expressions, declarations, and directives are also used.
- Implicit objects like request, response, out, and session are automatically available in JSP pages
The document discusses Java Server Pages (JSP) technology which provides a simplified way to create dynamic web content. JSP pages are compiled into servlets, allowing developers to embed Java code directly into HTML pages to interact with databases and other applications. The document covers key aspects of JSP including its architecture, lifecycle, directives like include and taglib, and how it enables rapid development of web applications.
The document discusses Java persistence and JPA 2. It introduces entity beans as persistent objects mapped to database tables. An entity bean represents data from a database table as a Java object. The document covers the lifecycle of entity beans, associations between entity beans like one-to-one and many-to-many relationships, and using the entity manager to persist, find, and remove entity beans from the database. It provides examples of entity bean classes annotated with JPA annotations and a persistence configuration file.
This document provides an overview of JSP (JavaServer Pages) basics. It discusses what JSP is, its advantages, the elements that make up a JSP file including directives, scripting elements, actions, and implicit objects. It also covers the JSP lifecycle, how JSP pages work, common directives like page and include, scripting elements like declarations, scriptlets and expressions, and standard actions like include, forward, useBean and setProperty. The document is intended to teach the fundamentals of JSP through explanations and examples.
This document introduces the Model-View-Controller (MVC) pattern and its evolution in web application design. It discusses the Model 1 architecture which is page-centric, and the Model 2 architecture which is servlet-centric. Model 2 architecture separates the application into three logical layers - the model, the view, and the controller. Web application frameworks like Struts are also introduced, which are based on MVC Model 2 architecture and provide common functionality to web applications.
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
The document discusses the history and evolution of Java EE and its specifications such as EJB and JSF. It introduces key concepts in Java EE 6 including Contexts and Dependency Injection (CDI), which provides a standard way to inject dependencies into Java objects without hardcoding them. CDI allows for loose coupling through contextual lifecycles and scopes, interceptors, and producers that control bean instantiation.
The document discusses new features in Oracle8i for administrators, including Java in the database, optimizer and query improvements, summary management, indexes and partitioning, universal installer migration and upgrade features, manageability features, availability and recoverability, Net8 features, SQL*Plus and national language support, database security, and partial additions. Key points covered include Java virtual machine integration, SQLJ and JDBC, using Java with Oracle, Java configuration, Internet file system, and stored outlines for optimizer plan stability.
This document provides an overview of Java Server Pages (JSP) technology. Some key points:
- JSP allows separation of work between web designers and developers by allowing HTML/CSS design and Java code to be placed in the same file.
- A JSP page is compiled into a servlet, so it can take advantage of servlet features like platform independence and database-driven applications.
- JSP pages use tags like <jsp:include> and <jsp:useBean> to include content and access JavaBeans. Scriptlets, expressions, declarations, and directives are also used.
- Implicit objects like request, response, out, and session are automatically available in JSP pages
The document discusses Java Server Pages (JSP) technology which provides a simplified way to create dynamic web content. JSP pages are compiled into servlets, allowing developers to embed Java code directly into HTML pages to interact with databases and other applications. The document covers key aspects of JSP including its architecture, lifecycle, directives like include and taglib, and how it enables rapid development of web applications.
The document provides an overview of the Java EE 6 programming model. It discusses new components in Java EE 6 like EJB 3.1, JPA 2.0, JSF 2.0, etc. It explains the core programming model which is built around concepts like managed beans, dependency injection, interceptors, and contexts and dependency injection (CDI). It describes how APIs work better together through integration of specifications like Bean Validation. It also covers principles of uniformity, extensibility, and how the programming model allows incremental development.
1) Enterprise JavaBeans (EJBs) are server-side components that expose methods for performing application logic. There are two main types: session beans and message-driven beans.
2) Session beans represent actions or a session and can be either stateless or stateful. Stateless session beans handle a single request and do not maintain conversational state, while stateful session beans span multiple requests and retain state for an individual client.
3) The document provides an example of a bank account application using EJBs, and describes the components of an EJB including business interfaces, EJB classes, and packaging into an EJB JAR file.
In this core java training session, you will learn Java IO – Files, Streams and
Object Serialization. Topics covered in this session are:
• Java IO
• Files
• Streams
• Byte-based
• Character-based
• Object Serialization
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document discusses JSP processing and elements. It states that JSP pages have a .jsp extension and are organized like HTML files. A JSP page is compiled to a servlet class when first requested or modified. The document also briefly mentions the MVC design pattern and describes common JSP elements like scriptlets, expressions, declarations, and directives.
8.1 Write the opening and closing tags for the following JSP tag
types: Directive ,Declaration ,Scriptlet ,Expression .
8.2 Given a type of JSP tag, identify correct statements about its purpose or use.
8.3 Given a JSP tag type, identify the equivalent XML-based tags.
8.4 Identify the page directive attribute, and its values, that:
Import a Java class into the JSP page
Declare that a JSP page exists within a session
Declare that a JSP page uses an error page
Declare that a JSP page is an error page
8.5 Identify and put in sequence the following elements of the JSP page life cycle: Page translation ,JSP page compilation, Load class,Create instance,Call jspInit,Call _jspService ,Call jspDestroy .
8.6 Match correct descriptions about purpose, function, or use with any of the following implicit objects: request, response ,out ,session ,config ,application ,Page ,pageContext, exception .
8.7 Distinguish correct and incorrect scriptlet code for: A conditional statement , An iteration statement
9.1 Given a description of required functionality, identify the JSP page directive or standard tag in the correct format with the correct attributes required to specify the inclusion of a web component into the JSP page.
The document provides an overview of enterprise bean world. There are three types of EJB components - session beans, message-driven beans, and entities. Session beans and message-driven beans are used to implement business logic while entities are used for persistence. Metadata annotations are used to configure EJBs by specifying services. EJBs allow building applications using traditional four-tier architecture or domain-driven design. Dependency injection is used to inject resources and components into EJBs.
Lecture 14 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
This document provides an overview of Enterprise Java Beans (EJB) including:
- The different types of EJB components including session beans, message-driven beans, and entities.
- Session beans can be stateless, stateful, or singleton and their differences are summarized.
- How EJB components are accessed through local, remote, and no-interface views using dependency injection or JNDI lookups.
- Message-driven beans process asynchronous JMS messages.
- Transactions, persistence contexts, and resources can be managed by the EJB container through annotations.
JSP (Java Server Pages) is a technology that allows the creation of dynamic web pages by embedding Java code in HTML pages. This provides a simpler way to add dynamic content to web pages compared to servlets. Some key points:
- JSP pages allow embedding of Java code in HTML pages using scripting elements like <% %> tags. This separates dynamic content from static content.
- JSP pages are compiled to servlets, separating the work of Java programmers and page authors.
- Common JSP elements include scriptlets, expressions, declarations, and directives that control things like page attributes and included files.
- JSP provides built-in support for HTTP sessions and can integrate with Java
This document discusses integrating JavaServer Faces (JSF), Enterprise Java Beans (EJB), and the Java Persistence API (JPA) in a Java EE application. It provides a brief overview of each technology and how they can be used together, with JSF for the presentation tier, EJBs for the business tier hosted in the EJB container, and JPA entities for the persistence tier. The document focuses on using annotations to enable dependency injection between the tiers, allowing JSF managed beans to access EJB session beans and JPA entities.
In this Java Spring Training session, you will learn Spring AOP – Aspect Oriented Programming Topics covered in this session are:
For more information, visit this link:
• Auto-wiring
• Annotations based configuration
• Java based configuration
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
The document provides an overview of Struts, a Java web framework that follows the model-view-controller (MVC) architecture. It discusses the core Struts components like the ActionServlet, action mappings in struts-config.xml, action classes, and form beans. It also provides steps to build a basic Struts application with a login page, and shows how to convert a regular JSP page to use Struts tags.
The document discusses the key changes and improvements in EJB 3.0, including a simplified programming model using annotations, a new entity bean development model and persistence functionality using the entity manager API. It provides an overview of the new approach and covers topics like entity beans and their lifecycle, the entity manager, queries, object-relational mapping, transactions and how session and message-driven beans work in EJB 3.0.
EJB3.1 defines enterprise beans as server-side components that encapsulate business logic. The main types of enterprise beans are session beans, message-driven beans, and entity beans. Session beans are further divided into stateless, stateful, and singleton beans. Enterprise beans provide benefits such as portability, transaction management, and scalability.
JavaServer Pages (JSP) allow developers to insert Java code into HTML pages using special tags. A JSP file is converted into a servlet class by the JSP container. The servlet class is then executed to generate an HTML response. The JSP lifecycle includes compilation, initialization, execution, and cleanup similar to a servlet lifecycle. Apache Tomcat is an open source web server that implements the JSP and servlet specifications and includes components like Catalina, Coyote, and Jasper to handle servlet container functions, HTTP connections, and JSP compilation respectively.
Introduction to java beans, java beans, Core java, j2se, getting started with java beans programming, java to standard edition, beans in java, beans programming in java
This document provides instructions for installing XAMPP server on Fedora Core 5 Linux. It discusses downloading and installing VMware Server to create a virtual machine for Fedora Core 5. It then walks through installing Fedora Core 5 in the virtual machine, including partitioning disks and setting the root password. It describes customizing the installation to minimize installed components by removing desktop environments and unnecessary servers. Finally, it discusses downloading and installing the FreshRPM package to enable easier installation of additional packages.
The document is a presentation about phpMyAdmin for beginners given by Jisse Reitsma. The presentation covers MySQL and how it relates to stacks like LAMP, introduces phpMyAdmin and how to perform tasks like SELECT queries, importing and exporting data. It also discusses advanced topics like JOINs, character encodings, storage engines and optimizing database performance.
The document discusses Java Server Pages (JSP) technology. It covers what JSP is, how JSP pages are processed, common JSP elements like scriptlets and directives, and how to use JavaBeans with JSP using tags like <jsp:useBean>, <jsp:setProperty>, and <jsp:getProperty>.
The document provides an overview of the Java EE 6 programming model. It discusses new components in Java EE 6 like EJB 3.1, JPA 2.0, JSF 2.0, etc. It explains the core programming model which is built around concepts like managed beans, dependency injection, interceptors, and contexts and dependency injection (CDI). It describes how APIs work better together through integration of specifications like Bean Validation. It also covers principles of uniformity, extensibility, and how the programming model allows incremental development.
1) Enterprise JavaBeans (EJBs) are server-side components that expose methods for performing application logic. There are two main types: session beans and message-driven beans.
2) Session beans represent actions or a session and can be either stateless or stateful. Stateless session beans handle a single request and do not maintain conversational state, while stateful session beans span multiple requests and retain state for an individual client.
3) The document provides an example of a bank account application using EJBs, and describes the components of an EJB including business interfaces, EJB classes, and packaging into an EJB JAR file.
In this core java training session, you will learn Java IO – Files, Streams and
Object Serialization. Topics covered in this session are:
• Java IO
• Files
• Streams
• Byte-based
• Character-based
• Object Serialization
For more information about this course visit on this link: https://www.mindsmapped.com/courses/software-development/learn-java-fundamentals-hands-on-training-on-core-java-concepts/
This document discusses JSP processing and elements. It states that JSP pages have a .jsp extension and are organized like HTML files. A JSP page is compiled to a servlet class when first requested or modified. The document also briefly mentions the MVC design pattern and describes common JSP elements like scriptlets, expressions, declarations, and directives.
8.1 Write the opening and closing tags for the following JSP tag
types: Directive ,Declaration ,Scriptlet ,Expression .
8.2 Given a type of JSP tag, identify correct statements about its purpose or use.
8.3 Given a JSP tag type, identify the equivalent XML-based tags.
8.4 Identify the page directive attribute, and its values, that:
Import a Java class into the JSP page
Declare that a JSP page exists within a session
Declare that a JSP page uses an error page
Declare that a JSP page is an error page
8.5 Identify and put in sequence the following elements of the JSP page life cycle: Page translation ,JSP page compilation, Load class,Create instance,Call jspInit,Call _jspService ,Call jspDestroy .
8.6 Match correct descriptions about purpose, function, or use with any of the following implicit objects: request, response ,out ,session ,config ,application ,Page ,pageContext, exception .
8.7 Distinguish correct and incorrect scriptlet code for: A conditional statement , An iteration statement
9.1 Given a description of required functionality, identify the JSP page directive or standard tag in the correct format with the correct attributes required to specify the inclusion of a web component into the JSP page.
The document provides an overview of enterprise bean world. There are three types of EJB components - session beans, message-driven beans, and entities. Session beans and message-driven beans are used to implement business logic while entities are used for persistence. Metadata annotations are used to configure EJBs by specifying services. EJBs allow building applications using traditional four-tier architecture or domain-driven design. Dependency injection is used to inject resources and components into EJBs.
Lecture 14 from the IAG0040 Java course in TTÜ.
See the accompanying source code written during the lectures: https://github.com/angryziber/java-course
This document provides an overview of Enterprise Java Beans (EJB) including:
- The different types of EJB components including session beans, message-driven beans, and entities.
- Session beans can be stateless, stateful, or singleton and their differences are summarized.
- How EJB components are accessed through local, remote, and no-interface views using dependency injection or JNDI lookups.
- Message-driven beans process asynchronous JMS messages.
- Transactions, persistence contexts, and resources can be managed by the EJB container through annotations.
JSP (Java Server Pages) is a technology that allows the creation of dynamic web pages by embedding Java code in HTML pages. This provides a simpler way to add dynamic content to web pages compared to servlets. Some key points:
- JSP pages allow embedding of Java code in HTML pages using scripting elements like <% %> tags. This separates dynamic content from static content.
- JSP pages are compiled to servlets, separating the work of Java programmers and page authors.
- Common JSP elements include scriptlets, expressions, declarations, and directives that control things like page attributes and included files.
- JSP provides built-in support for HTTP sessions and can integrate with Java
This document discusses integrating JavaServer Faces (JSF), Enterprise Java Beans (EJB), and the Java Persistence API (JPA) in a Java EE application. It provides a brief overview of each technology and how they can be used together, with JSF for the presentation tier, EJBs for the business tier hosted in the EJB container, and JPA entities for the persistence tier. The document focuses on using annotations to enable dependency injection between the tiers, allowing JSF managed beans to access EJB session beans and JPA entities.
In this Java Spring Training session, you will learn Spring AOP – Aspect Oriented Programming Topics covered in this session are:
For more information, visit this link:
• Auto-wiring
• Annotations based configuration
• Java based configuration
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
The document provides an overview of Struts, a Java web framework that follows the model-view-controller (MVC) architecture. It discusses the core Struts components like the ActionServlet, action mappings in struts-config.xml, action classes, and form beans. It also provides steps to build a basic Struts application with a login page, and shows how to convert a regular JSP page to use Struts tags.
The document discusses the key changes and improvements in EJB 3.0, including a simplified programming model using annotations, a new entity bean development model and persistence functionality using the entity manager API. It provides an overview of the new approach and covers topics like entity beans and their lifecycle, the entity manager, queries, object-relational mapping, transactions and how session and message-driven beans work in EJB 3.0.
EJB3.1 defines enterprise beans as server-side components that encapsulate business logic. The main types of enterprise beans are session beans, message-driven beans, and entity beans. Session beans are further divided into stateless, stateful, and singleton beans. Enterprise beans provide benefits such as portability, transaction management, and scalability.
JavaServer Pages (JSP) allow developers to insert Java code into HTML pages using special tags. A JSP file is converted into a servlet class by the JSP container. The servlet class is then executed to generate an HTML response. The JSP lifecycle includes compilation, initialization, execution, and cleanup similar to a servlet lifecycle. Apache Tomcat is an open source web server that implements the JSP and servlet specifications and includes components like Catalina, Coyote, and Jasper to handle servlet container functions, HTTP connections, and JSP compilation respectively.
Introduction to java beans, java beans, Core java, j2se, getting started with java beans programming, java to standard edition, beans in java, beans programming in java
This document provides instructions for installing XAMPP server on Fedora Core 5 Linux. It discusses downloading and installing VMware Server to create a virtual machine for Fedora Core 5. It then walks through installing Fedora Core 5 in the virtual machine, including partitioning disks and setting the root password. It describes customizing the installation to minimize installed components by removing desktop environments and unnecessary servers. Finally, it discusses downloading and installing the FreshRPM package to enable easier installation of additional packages.
The document is a presentation about phpMyAdmin for beginners given by Jisse Reitsma. The presentation covers MySQL and how it relates to stacks like LAMP, introduces phpMyAdmin and how to perform tasks like SELECT queries, importing and exporting data. It also discusses advanced topics like JOINs, character encodings, storage engines and optimizing database performance.
The document discusses Java Server Pages (JSP) technology. It covers what JSP is, how JSP pages are processed, common JSP elements like scriptlets and directives, and how to use JavaBeans with JSP using tags like <jsp:useBean>, <jsp:setProperty>, and <jsp:getProperty>.
This document provides instructions for installing Xerte Online Toolkits using XAMPP on a local machine or on a web server. It describes how to install and use XAMPP, extract and run the Xerte installer, and configure PHP and server settings. The document also covers authentication options, using the management interface, and limitations of a local install versus a full web server install.
phpMyAdmin es una herramienta gratis y de código abierto, escrita en PHP, y que sirve para administrar bases de datos MySQL a través de una página web.
Con esta herramienta puedes crear y borrar bases de datos; alterar, crear, eliminar tablas; borrar, añadir, editar campos; o simplemente ejecutar sentencias de SQL.
http://leccionesweb.com/
Introducing the MySQL Workbench CASE toolAndrás Bögöly
Introducing the ER Model, and the The MySQL Workbench CASE tool with its Database modeling, database SQL development and some aspects of the change management capabilities.
The document discusses JSPs (JavaServer Pages) and how they allow for the creation of dynamic web content by mixing static HTML with Java code, describing how JSPs are translated into servlets at request time to generate dynamic output. It provides an overview of why JSPs are used, how they work, and some of their advantages over other technologies like servlets for building web applications.
This document provides an overview of JSP/Servlet architecture. It describes how a web request is handled from the browser to the web server and JSP/Servlet container. It then discusses key components like servlets, JSPs, the request and response objects. It provides examples of basic servlet and JSP code to output text and access request parameters. It also covers servlet configuration, mappings, and the use of forwards and redirects.
The document provides an introduction to Java servlets and JavaServer Pages (JSP). It discusses servlet lifecycles and interfaces like ServletRequest and RequestDispatcher. It covers session tracking techniques including cookies, hidden form fields, and URL rewriting. It also mentions servlet events and listeners.
In today's high technology environment, organizations are becoming more and more dependent on their information systems. The public is increasingly concerned about the proper use of data and information. Most Organizations like banks, airlines, markets, manufactures and universities widely used computer systems to manage, manipulate and process their information. Many of today's most widely used computer systems are database applications, for example, Amazon, which was built on top of MySQL. Database application is involved like everywhere in our world, it touches all aspects of our lives.
A database application is a computer program whose primary purpose is entering and retrieving information from a computerized database. Early examples of database applications were accounting systems and airline reservations systems.
The aim of this course is to explore fundamentals of database application related to MySQL, phpMyAdmin, MySQL command lines, apache server and PHP Maker. It details the relational database principles. It shows how to build and develop database application with web interface.
Upon completion of this course, computer students will have gained knowledge of database application concepts and the ability to:
Must know the basic concepts related relational database application.
Must know how to manage relational database via using MySQL command line and phpMyAdmin.
Must know how to build database application with web interface by using MySQL and PHPMaker.
A combination of lectures and practical sessions will be used in this course in order to achieve the aim of the course.
By MSc. Karwan Mustafa Kareem
XAMPP is a free and open source cross-platform web server package that consists of Apache HTTP Server, MySQL database, and interpreters for PHP and Perl scripts. It allows users to set up a local development environment for web development. XAMPP stands for Cross-platform (X), Apache HTTP Server, MySQL, PHP, and Perl. It provides a simple way for users, especially beginners, to start developing and testing websites locally without needing to install separate programs.
Mumbai Academics is Mumbai’s first dedicated Professional Training Center for Training with Spoke and hub model with Multiple verticles . The strong foundation of Mumbai Academics is laid by highly skilled and trained Professionals, carrying mission to provide industry level input to the freshers and highly skilled and trained Software Professionals/other professional to IT companies.
The document summarizes a study conducted by the RAAF Institute of Aviation Medicine to measure the real-world effectiveness of foam earplugs when used by untrained users, compared to laboratory tests. 43 aircrew had their earplug insertion technique and noise attenuation measured before and after a brief insertion training. Results showed that before training, earplugs provided significantly less attenuation than factory specifications, but attenuation improved by an average of 10 dB after training. The study demonstrates the importance of proper insertion technique training to maximize hearing protection and reduce noise exposure risks for aircrew.
This document lists the provisional scores of players in a game, along with their initial score, final score, point difference, and percentage increase. The top player increased their score by 6,437 points (1.72% increase) while some at the bottom did not change their score at all (0% increase).
This document outlines Marc Edsel C. Ayes' 20-year marketing plan for Edsel, referred to as "Ah!YES MAN!". The plan emphasizes an attitude of openness, adventure, and constant self-improvement. It details Ayes' vision to challenge status quo thinking and encourage others to live life to the fullest without regrets. The core roles involve thinking positively, dreaming big, accepting challenges, doing things in a big way, knowing what you want, not forgetting your roots, and saying "yes" to God. The plan also involves goal-setting, self-projects, monitoring progress, and embracing continuous improvement.
This document provides an overview and comparison of Google App Engine (GAE) and Amazon Web Services (AWS) for hosting applications and services in the cloud. It outlines some of the key features of each including autoscaling, programming languages supported, databases, limitations, pricing models, and example uses. GAE focuses on being easy to use with automatic scaling but has some limitations around customization. AWS provides more flexibility and control through its infrastructure as a service model but requires more management. Both offer free tiers for new users and pay-as-you-go pricing thereafter.
Botox use is predicted to increase in London as residents feel pressure to look youthful in fast-paced environments. While cosmetic surgeries slowed in 2009, injectables like Botox and Juvederm that provide instant facial tightening and lifting are expected to be used together more often by London residents seeking a refreshed look. The Kensington Esthetic Clinique offers these hybrid treatments and more information can be found on their website.
JSF 2 life cycle consists of 6 phases: restore view, apply request values, process validations, update model values, invoke application, and render response. Managed beans are JavaBeans that can be accessed from JSF pages and are used to store data. Facelets is the templating language used by JSF 2 that replaced JSP. Navigation between pages can be done through configuration, implicit navigation based on action outcomes, or redirection. New features in JSF 2.2 include faces flows for page flows, HTML5 support, and a file upload component.
This document provides an overview of JavaServer Faces (JSF), a Java framework for building user interfaces for web applications. It discusses that JSF is a standard Java framework created as a Java Community Process to make client-side development browser-independent and include features like state management. It also summarizes that JSF uses a model-view-controller approach with UI components on the server-side, has a defined programming model and tag libraries, and helps with reusability and easier event handling and separation of behavior and presentation. Finally, it provides examples of converting a JSP to a JSF page and using managed beans and navigation in JSF applications.
This document provides an overview of JavaServer Faces (JSF), a Java framework for building user interfaces for web applications. It discusses that JSF is a standard created by Java Community Process to make client-side development browser-independent and include features like state management. It also describes key characteristics of JSF like being server-side, using a component framework, and supporting features like validation and error handling. The document outlines the JSF application lifecycle process and how JSF uses managed backing beans to hold user-entered data. It provides examples of converting a JSP to a JSF page and the JSF navigation model.
Facelets is a view handler for JSF that avoids using JSP, instead using .xhtml files. It allows for templating through ui:composition and ui:define tags. Facelets also supports EL functions, custom logic tags, and JSTL tags. Facelets provides a faster and more lightweight alternative to using JSP with JSF.
This document provides an overview of JavaServer Faces (JSF), including:
- An introduction to JSF and what it is
- A description of the JSF request lifecycle and faces servlet
- An explanation of JSF component models and commonly used tags
- A step-by-step guide for creating a basic "Hello World" JSF application
- Details about JSP architectures (Model 1 and Model 2) that provide context for JSF
JSF 2.0 provides many new features and improvements over JSF 1.x including built-in Ajax support, easier component development through annotations and resource handling, additional scopes like ViewScope, and a Page Description Language (PDL) based on Facelets. It aims to address issues with JSF 1.x like performance, exception handling, and reduce unnecessary configuration through conventions over configuration.
JSF 2 Notes with coding examples topics include introduction , managed bean, jsf tags, navigation, jsf life cycle and phase listners,jsf validation and converters, i18n
The document discusses different ways to invoke Java code from JSP pages, including JSP expressions, scriptlets, and declarations. It provides examples of each and explains how they correspond to code in the generated servlet class. Expressions output a value, scriptlets can contain multiple statements, and declarations define fields and methods in the servlet class. The document also compares using JSP pages versus servlets for similar tasks and recommends limiting Java code in JSP pages.
1. The document provides an overview of the major Java 2 Enterprise Edition (J2EE) technologies including Java servlets, JavaServer Pages (JSP), Enterprise JavaBeans (EJB), Java Message Service (JMS), Java Database Connectivity (JDBC), and Java Naming and Directory Interface (JNDI).
2. It describes the basic anatomy and functionality of servlets, JSP, EJB components including session and entity beans, and JMS.
3. Examples of simple servlet, JSP, EJB, and JMS code are included to illustrate how each technology can be implemented.
This document provides an overview of Java Server Pages (JSP) technology. It discusses JSP architecture and components like expressions, scriptlets, declarations, comments, directives, standard actions, implicit objects, and JavaBeans. Expression Language (EL) is also introduced, which allows accessing Java objects in JSP using a simpler syntax. Key elements like scopes, operators, and implicit objects available in EL are explained.
JSP technology facilitates separating the work of web designers and developers. Web designers can create HTML layouts while developers write Java code and JSP tags for business logic. A JSP page compiles to a servlet, allowing incorporation of servlet functionality. Servlets and JSPs share features like platform independence and database-driven applications. However, servlets tie static and dynamic content to separate files requiring recompilation on changes, while JSPs allow embedding Java directly in HTML pages. The JSP lifecycle involves translation to a servlet by the container and processing of requests and responses.
The document discusses Java Server Pages (JSP) technology. It explains that JSP allows separation of work between web designers and developers by allowing HTML design and Java coding. A JSP page compiles to a servlet, sharing features with servlets like platform independence and database-driven applications. However, servlets tie static and dynamic content across multiple files while JSP allows embedding Java code directly into HTML pages. The document also covers JSP tags, directives, the JSP life cycle, and core JSP classes.
This document provides an introduction to Java Server Faces (JSF) and the Seam framework, including their architectures, configurations, features, pros, and cons. JSF is a Java specification for building component-based user interfaces for web applications, while Seam extends JSF by adding features like state management, Ajax support, and page flows. The document outlines the MVC architectures of both technologies and demonstrates features like validation, error handling, and data binding through examples. It concludes by discussing advantages of Seam and shortcomings of plain JSF.
The document provides an overview of J2EE (Java 2 Enterprise Edition) technologies including servlets, JSP, EJB, and how they are used to build web applications. It describes the major components of J2EE like servlets, JSP, EJB, their anatomy and usage. Sample code is also included to demonstrate servlets and JSP.
This document provides an overview of JavaServer Faces (JSF):
- JSF is a user interface framework for developing Java web applications using reusable UI components.
- It follows a MVC architecture with components representing the view, backing beans representing the model/controller.
- JSF applications typically include Facelets or JSP views, backing beans, a web deployment descriptor, and optional configuration files.
- The document demonstrates creating a simple JSF application in NetBeans and provides examples of developing backing beans and JSF pages.
JSF 2.0 tutorials provide an overview of topics covered including JSF 2.0 introduction, managed beans and scoping, JSF tags, navigation, lifecycle and listeners, validators, converters, and internationalization. The document discusses key aspects of JSF including it being a Java EE standard web application framework, implementing the MVC pattern, providing reusable UI components, and extensibility. It also provides an example "hello world" JSF application and demonstrates managed bean scoping with different beans.
JSP page life cycle involves compiling JSP pages into servlets that can then handle requests. When a JSP page is first requested, the JSP engine compiles it into a servlet class. This servlet class then handles subsequent requests to that JSP page until it is modified, at which point it will be recompiled. The main lifecycle methods are jspInit(), which initializes the JSP, and jspService(), which processes each request. When the JSP is destroyed, jspDestroy() is called.
Expression Language (EL) allows easy access to application data in JSPs. It searches for attributes in page, request, session and application scopes. Implicit EL objects provide access
JavaServer Pages (JSP) is a technology that allows developers to embed Java code in HTML pages to create dynamic web content. JSP pages combine HTML code with JSP actions and commands. At runtime, JSP pages are translated into Java servlets that generate the web page content dynamically. This provides better performance than CGI and allows embedding of dynamic elements directly into HTML pages.
JSP provides implicit objects that represent request, response, and session objects. These objects have different scopes: page, request, session, and application. The implicit objects allow access to these server-side objects from JSP. JSP actions like include, forward, plugin are processed during request processing to include, forward to, or embed resources. The useBean, getProperty, and setProperty actions allow interacting with JavaBeans in JSP.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
What is Master Data Management by PiLog Groupaymanquadri279
PiLog Group's Master Data Record Manager (MDRM) is a sophisticated enterprise solution designed to ensure data accuracy, consistency, and governance across various business functions. MDRM integrates advanced data management technologies to cleanse, classify, and standardize master data, thereby enhancing data quality and operational efficiency.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
2. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 2
Content
• Overview of JSF and JSP
• JSF Introduction
• JSF tags
• Managed Beans
• Expression language
• JSP Standard Tag Library (JSTL)
• JSF Navigation and validation
• JSP Overview
3. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 3
Design of a Java EE application
• This is covered in the exercise
4. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 4
Two Different View Technologies
JavaServer Faces, JSF
– Newer
– Dynamic views
– Handles non-functional requirements like navigation,
validation, composite views and view templates.
– XHTML pages with JSF-specific tags that are converted to
XHTML tags.
– Handled by the JSF framework that run inside the Servlet
container.
5. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 5
Two Different View Technologies,
Cont'd
• JavaServer Pages, JSP
– Older, left mainly for backwards compatibility
– Dynamic views
– Does not handle non-functional requirements.
– JSP pages with JSP-specific tags. The pages are
translated into Servlets.
– Handled by the Servlet container itself.
6. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 6
Why Use JSF Instead of Plain JSP
Avoid writing infrastructure code for non-
functional requirements like navigation, validation,
composite views and view templates.
• Thoroughly tested and proven to work well.
• Lots of documentation, easy to get help.
• Not using a framework means writing new code
which means introducing new bugs.
7. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 7
Why Use JSF Instead of Plain JSP?
Cont'd
• Non-functional requirements are difficult to code.
• Callback style makes sure all calls to non-
functional requirements code are made at the right
time.
– Handled by the framework.
9. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 9
A Simple Example
The example has two views.
10. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 10
A Simple Example, Cont'd
The first JSF page, index.xhtml.
11. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 11
A Simple Example, Cont'd
The second JSF page, welcome.xhtml.
12. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 12
A Simple Example, Cont'd
The managed bean, User.java.
13. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 13
Overview of JSF Architecture
• JSF has a component based architecture
– Treats view parts as UI components, not as HTML
elements.
– Maintains an internal component tree.
– Think of it as a Swing or AWT UI.
– index.xhtml in the initial example has three
components. The first, a form, is the ancestor of the
other two, a button and a text field.
14. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 14
Overview of JSF Architecture,
Cont'd
• Each tag in a page has an internal associated tag
handler class inside JSF.
– The tag handler classes are organized according to the
component tree.
• The internal JSF classes handles translation of JSF
tags to HTML tags, interpretation of Http requests,
calls to managed beans etc.
15. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 15
The Phases of a JSF Request
16. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 16
The Phases of a JSF Request
• Restore View Phase
– Retrieves the component tree (i.e. tree of internal tag
handler classes) for the page if it was displayed
previously. It the page is displayed the first time the
component tree is instead created.
– If there are no Http parameters in the request JSF skips
directly to the Render Response phase.
17. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 17
The Phases of a JSF Request, Cont'd
• Apply Request Values Phase
– The Http request parameters are placed in a hash table
that is passed to all objects in the component tree.
– Each object identifies the parameters belonging to the
component it represents and stores those parameter
values.
– Values stored in objects in the component tree are
called local values.
18. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 18
The Phases of a JSF Request, Cont'd
• Process Validations Phase
– It is possible to attach validators to user editable components (typically text
fields) in a JSF page, using JSF tags.
– Example of validators are that a field is not empty, that a parameter is an
integer, that it is a string of a certain length etc.
– In this phase, the validators are executed to check that the local values are
correct.
– If some validation fails JSF skips to the Render Response phase and
redisplays the current page with error messages about the failed validations.
19. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 19
The Phases of a JSF Request, Cont'd
• Update Model Values Phase
– The local values are used to update managed beans by
invoking setter methods.
– Managed beans and their properties are identified by
their names, in the index.html page in the initial
example the user enters their name in a text field that
has the value user.name. This means the name is
sent to the method setName in the managed bean that
is named user.
20. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 20
The Phases of a JSF Request, Cont'd
• Invoke Application Phase
– Here the method specified by the action attribute of
the component that caused the Http request is called.
21. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 21
The Phases of a JSF Request, Cont'd
• Render Response Phase
– Here the next view is created.
– Everything in the XHTML page except JSF tags is unchanged.
– JSF tags are transformed to XHTML tags by the objects in the
component tree.
– Getter methods in managed beans are called in order to retrieve
values. In the welcome.xhtml page in the initial example the
value user.name is retrieved by a call to the method getName in
the managed bean that is named user.
22. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 22
Tag Libraries in JSF
• HTML
– Used to create HTML elements.
– The recommended prefix is h:
– Some important tags are covered below.
• Core
– Used to add objects , such as validators, listeners and
AJAX support, to HTML elements.
– The recommended prefix is f:
– Example in the slides explaining validation.
23. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 23
Tag Libraries in JSF, Cont'd
• Facelets
– Used to create composite views, e.g. views that have
common components like header, footer and menu,
without using duplicated code.
– The recommended prefix is ui:
– Not covered in this course.
24. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 24
Tag Libraries in JSF, Cont'd
• Composite Components
– Used to create custom components.
– The recommended prefix is composite:
– Not covered in this course.
25. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 25
Tag Libraries in JSF, Cont'd
JSTL (JSP Standard Tag Library) Core
– Utility tags managing for example flow control.
– The recommended prefix is c:
– Some important tags are covered below.
• JSTL (JSP Standard Tag Library) Functions
– Utility functions mainly for handling strings.
– The recommended prefix is fn:
– Some example tags are covered below.
26. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 26
Tag Library Declaration
Tag libraries must be declared in the XHTML
page where they are used.
This is done in the <HTML> tag.
The index.xhtml in the initial example uses
the HTML tag library. It is declared as follows.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
27. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 27
Some Tags in the HTML Tag
Library
• head, renders the head of the page.
• body, renders the body of the page.
• form, renders an HTML form.
• inputText, renders an HTML text field.
• inputSecret, renders an HTML password field.
• outputLabel, renders a plain text label for another
component.
• outputText, renders plain text.
• commandButton, renders a submit button.
28. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 28
Attributes for The HTML Tags
• All tags mentioned on the preceding page, except head and body,
have the following attributes.
– id, gives a unique name to the component. All components have a unique
name. It is assigned by JSF if not stated explicitly with the id tag.
– value, specifies the component's currently displayed value. This can be an
expression that refers to a property in a managed bean. If so, the value will
be read from the bean when the component is displayed and stored to the
bean when the component is submitted.
– rendered, a boolean expression that tells whether the component is
displayed or not.
29. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 29
Attributes for The HTML Tags,
Cont'd
The outputLabel tag also has the for
attribute.
Specifies for which other component this component is
a label. The label is normally displayed immediately to
the left of that other component.
30. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 30
Attributes for The HTML Tags,
Cont'd
The commandButton tag also has the action
attribute.
Tells what to do when the user clicks the button.
Can be the name of a XHTML page, without the
.xhtml extension. In this case the specified page is
displayed.
Can also be the name of a method in a managed bean,
in this case that method is invoked.
31. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 31
JSTL (JSP Standard Tag Library)
Core Tags
• choose, an if statement.
<c:choose>
<c:when test="#{condition}">
The condition was true.
</c:when>
<c:otherwise>
The condition was false.
</c:otherwise>
</c:choose>
• If the boolean condition specified in the test
attribute is true, the when block is executed, if not
the otherwise block is executed.
32. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 32
JSTL (JSP Standard Tag Library)
Core Tags, Cont'd
• forEach, a loop statement.
<c:forEach var="element" items="#{myList}"
varStatus="loopCount" >
Element number #{loopCount.count} is #{element}
</c:forEach>
• The var attribute specifies the name of the variable holding the current
element's value. This variable is used when the value shall be displayed.
• The items attribute refers to the collection that shall be iterated over.
• The varStatus attribute defines a variable that holds information like the
current element's index in the collection.
33. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 33
Functions In the JSTL (JSP Standard
Tag Library) Functions Library
• Note that these are functions, not tags.
• contains(str, substr), returns true if
str contains substr.
• startsWith(str, substr, returns true if
str starts with substr.
• length(str), returns the length of str.
• And many more.
34. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 34
JSTL (JSP Standard Tag Library)
Functions Functions, Cont'd
• Example:
35. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 35
Managed Beans
• Managed beans are plain Java classes.
– Must have a public no-arg constructor.
– Annotated @Named(“myName”), where myName becomes the name of the
bean.
• The beans are managed by the CDI (Context and Dependency Injection)
container.
– Part of Java EE
– Creates and connects objects according to specifications in annotations.
– Supports insertion of decorators and interceptors, which are objects that will be
called before and after method calls.
– Powerful framework, but not covered in this course.
36. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 36
Managed Beans, Cont'd
• All managed beans have a scope which defines their life time. Some scope annotations are:
– ApplicationScoped, the object will exist for the entire application life time.
– SessionScoped, the object will be discarded when the current Http session ends.
– ConversationScoped, a conversation can be started and stopped manually in the
code. If it is not, it has the life time of a Http session. Unlike sessions, conversations are
unique for each browser tab and therefore thread safe.
– RequestScoped, the object will be discarded when the current Http request is
handled.
38. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 38
Expression Language
• The expression language is used in dynamic
expressions in JSF (and JSP) pages.
– Stateless, variables can not be declared.
– Statements are written between #{ and }
– The result of an EL statement is a string.
39. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 39
Expression Language, Cont'd
• The syntax is
#{something.somethingElse}, where
something is for example one of the following:
– The name of a managed bean.
– param, which is a java.util.Map containing all
HTTP request parameters. If there are more parameters
with the same name the first is returned.
– paramValues, which is a java.util.Map
containing all HTTP request parameters. No matter how
many parameters there are with the specified name a
java.util.List with all of them is returned.
40. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 40
Expression Language, Cont'd
– header, which is a java.util.Map containing all
HTTP headers. If there are more headers with the same
name the first is returned.
– headerValues, which is a java.util.Map
containing all HTTP headers. No matter how many
headers there are with the specified name a
java.util.List with all of them is returned.
– cookie, which is a java.util.Map containing all
HTTP cookies.
41. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 41
EL, The Operators . and []
• If the operator . is used
(#{something.somethingElse}) the
following must be true.
– something is a java.util.Map or a managed
bean.
– somethingElse is a key in a java.util.Map or
a property in a managed bean or a method in a managed
bean.
42. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 42
EL, The Operators . and [], Cont'd
• If the operator [] is used
(#{something[“somethingElse”]}) the
following must be true.
– something is a java.util.Map, a managed bean, an
array or a java.util.List.
– If somethingElse is a string (surrounded by double
quotes, “”) it must be a key in a java.util.Map, a
property in a managed bean, an index to an array or an
index to a java.util.List.
– If somethingElse is not surrounded by double quotes it
must be a valid EL statement.
43. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 43
EL Examples
• If these are managed beans:
@Named(“person”)
public class PersonBean {
@Inject private DogBean dog;
public DogBean getDog() {
return dog;
}
}
@Named(“dog”)
public class DogBean {
private String name;
public String getName() {
return name;
}
}
• Then it is allowed to write #{person.dog.name} or
#{person[dog["name"]]}.
44. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 44
EL Examples, Cont'd
• Input from an HTML form:
<form>
Address: <input type="text" name="address">
Phone1: <input type="text" name="phone">
Phone2: <input type="text" name="phone">
</form>
• Can be read like this:
The address is #{param.address}
Phone1 is #{param.phone}
Phone1 is #{paramValues.phone[0]}
Phone2 is #{paramValues.phone[1]}
• However, there is seldom any need for this since request
parameters are normally handled by managed beans.
45. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 45
The EL Operators
• Remember that JSF/JSP pages are views and thus not the place for a lot
of calculations.
• Arithmetic
– addition: +
– subtraction: -
– multiplication: *
– division: / or div
– remainder: % or mod
• Logical
– and: && or and
– or: || or or
– not: ! or not
46. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 46
The EL Operators, Cont'd
• Relational
– equals: == or eq
– not equals: != or ne
– less than: < or lt
– greater than: > or gt
– less than or equal to: <= or le
– greater than or equal to: >= or ge
47. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 47
EL, Null Values
• Since EL is used for user interfaces it produces the
most user friendly output.
• This means that (like HTML) it tries to silently ignore
errors.
• Null values does not generate any output at all, no
error messages are produced.
48. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 48
Navigation
• What calls should be made to the model and which is the
next view, provided the user has clicked YYY in view ZZZ.
• The next view may differ depending on the outcome of the
call to the model.
• Answers to the above should be stated as a set of navigation
rules that are easy to change.
– The value of the action attribute of the button or link the user
invoked is called the outcome. The navigation handling
depends on the outcome.
49. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 49
Static Navigation
• If the outcome is the name of a XHTML page then
that page is displayed.
– This is called static navigation. The outcome is always
the same.
50. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 50
Dynamic Navigation
• A user action can often have different outcomes,
for example a login attempt might succeed or fail.
• In this case dynamic navigation must be used.
51. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 51
Dynamic Navigation, Cont'd
• Using dynamic navigation the value of the action attribute must be
an expression identifying a method, for example
#{loginManager.validateUser}, assuming that there is a
managed bean named loginManager that has a method called
validateUser.
• The outcome will be the value that is returned by this method. If
the return value is not a String it will be converted to a String
by calling its toString method.
• The outcome could be the name of a XHTML page, just like with
static navigation. If so this page will be displayed.
52. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 52
Dynamic Navigation, Cont'd
• It is not a good design that methods in the model
knows names of XHTML files.
• Therefore we want to have the action handling
method return a logical view name that is mapped
to a XHTML file name.
53. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 53
Dynamic Navigation, Cont'd
• This is achieved by adding a navigation rule to the faces-config.xml file
<navigation-rule>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/welcome.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
• The above means that if an action handling method specified on the login.xhtml
page returns success the welcome.xhtml page is displayed next. If on the other
hand the method returns failure the login.xhtml page is displayed again.
54. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 54
Dynamic Navigation, Cont'd
• Even though the action handling method now returns a logical
outcome, one could argue that we still have some amount of
mixture of business logic and view handling.
• Consider for example a method withdraw in a bank
application. Such a method would normally be void, but would
now instead have to return the String success only to
indicate to JSF that the withdrawal was successful.
55. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 55
Dynamic Navigation, Cont'd
• To avoid this problem we can let the withdraw method
remain void, and instead add another method, success, that
returns true only if the last transaction was successful.
faces-config.xml would then look as follows.
<navigation-rule>
<from-view-id>/withdraw.xhtml</from-view-id>
<navigation-case>
<if>#{bankManager.success}</if>
<to-view-id>/success.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
56. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 56
No Matching Navigation Case
• If there is an outcome that does not correspond to
a XHTML file and that has no matching
navigation case, the last page is displayed again.
57. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 57
Validation
• Check data entered by the user.
• If validation fails the same view is shown again
together with an error message.
• Which validations are to be made on what and
which error messages to show if they fail is
specified by attaching validators to user input
components.
58. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 58
Validation, Cont'd
• Validation concerns only checks that can be done
without understanding the meaning of the input.
The check should not include business logic.
– For example that a field is not empty, that it contains an
integer or that it is an email address.
• Since some validation checks, like those
mentioned above, occur frequently they are
predefined in JSF.
59. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 59
Validation Example
<h:inputText id="name" label="Name" value="#{user.name}">
<f:validateRequired/>
</h:inputText>
<h:message for="name"/>
• The validateRequired tag checks that the text
field is not empty.
• The message tag displays the error message if the
validation failed.
• It is possible to customize the error message, but that
is outside this course.
60. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 60
Composite Views
Views often consist of several parts like header, footer,
navigation menus, main content etc.
Many of these parts are common for different views.
In order to avoid duplicated code it must be possible to reuse
both page fragments (html) and page layout (html tables or css).
Handled by the facelets tag library, but not covered in this
course.
61. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 61
Internationalization (i18n) and
localization (l10n)
• Internationalization means to make it possible to switch
language. To add the possibility to show the user
interface in a new language should only require to write
the words in the new language, not any additional
coding.
• Localization means to add support for a new language.
• Handled by the JSF core tag library, but not covered in
this course.
63. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 63
What Is JSP?
• Framework used before JSF.
• A JSP page is written in HTML and translated to a
Servlet by the Servlet container.
• Dynamically-generated web content
– Communicates with model objects written in Java
64. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 64
The Life Cycle of a JSP
• At the first call:
– The container translates the JSP to a servlet (translation
time)
– The container compiles the servlet (compile time)
– The container instantiates the servlet the same way it
instantiates any servlet.
– The container calls jspInit().
65. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 65
The Life Cycle of a JSP, Cont'd
• At all calls:
– The container calls _jspService() of the servlet that was
generated at the first call (request time).
• If the JSP is unloaded from the container:
– The container calls jspDestroy().
69. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 69
A Translated JSP, Cont'd
• The generated servlet (cont):
out.write("<html>n");
out.write(" <head>n");
out.write(" <title>Hello World!</title>n");
out.write(" </head>n");
out.write("n");
out.write(" <body>n");
out.write(" <h1>Hello World!</h1>n");
out.write(" </body>n");
out.write("</html>n");
out.write("n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
• The response is sent.
70. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 70
Where Can I Find the Translated
JSPs?
• Like the translation itself, that is server dependant.
Tomcat (5.5.15) places them in
TOMCAT_HOME/work/Catalina/localhos
t/jsp/org/apache/jsp in a file called
<name of the jsp>_jsp.java, that is
xyz_jsp.java if the jsp is called xyz.jsp.
71. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 71
Actions and Directives
• A directive is an instruction to the container about
the translation of a JSP.
– Does not exist in the translated Java code.
– There are three directives: page, taglib and include.
– Written between <%@ and %>
(for example <%@page ... %>).
72. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 72
Actions and Directives, Cont'd
• An action is translated into Java code and executed
at request time.
– Syntax: <prefix:action name/>
– Standard actions are defined in the specification and
have the prefix jsp.
– Custom tags are defined by the developer and may have
any prefix (except reserved prefixes like jsp).
73. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 73
To Include Other Files
• The include directive:
– <%@include file="header.jsp"%>
– The directive is replaced with the content of the
specified file (header.jsp) at translation time.
– Both static (for example HTML files) and dynamic
content (for example other JSP files) can be included.
– The path to the included file is specified relative to the
file with the include directive.
74. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 74
To Include Other Files, Cont'd
• The jsp:include standard action:
– Syntax: <jsp:include page="header.jsp"/>
– The included page is translated to a servlet that is called
(that is, its _jspService() method is called) by the
including servlet at request time.
– Only JSPs can be included.
– The output of the included Servlet is inserted in the
output of the including Servlet.
– The path to the included page is a URL. It is either
relative to the URL of the including page or absolute
starting with the context root of the web application.
75. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 75
To Include Other Files, Cont'd
• It is possible to pass parameters to the included
page if the jsp:include action is used.
– The following code should be placed in the including
page:
<jsp:include page="header.jsp">
<jsp:param name=subTitle" value="A dynamic subtitle"/>
</jsp:include>
– The parameter subTitle will be available as an
HTTP request parameter in the included page.
– It can be output like this:
<h3>${param.subTitle}</h3>
76. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 76
Error handling
• It is possible to define error pages. If an exception occurs
in a JSP (or servlet) the container forwards the call to the
error page.
– Error pages are defined like this in the deployment descriptor:
<!-- An error page for a Java exception. The call is forwarded
to the error page if the specified exception or a subclass of it
is thrown. -->
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorpage.jsp</location>
</error-page>
<!-- An error page for an HTTP error -->
<error-page>
<error-code>404</error-code>
<location>/errorpage.jsp</location>
</error-page>
77. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 77
Error handling, Cont'd
• An example of an error page:
<%@ page isErrorPage="true" %>
<html>
<head>
<title>This page handles exceptions</title>
</head>
<body>
<h1>This page handles exceptions</h1>
<p>An ${pageContext.exception} was thrown. Its message was:
${pageContext.exception.message}</p>
</body>
</html>
• This must always be written in an error page.
• This is the exception object that was thrown.
78. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 78
NEVER EVER Write Java code in a
JSP
• There are ways to insert Java code directly in a
JSP.
– Possible only for backwards compatibility
• NEVER EVER do that!
– Gives high coupling and low cohesion.
– Makes the code inflexible, difficult to understand and
hard to maintain.
– Forces web page designers to learn Java programming.
• Use EL and custom tags instead.
79. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 79
The <%@taglib%> directive
• Used to declare custom tags that are used in a JSP
• Syntax:
<%@ taglib prefix="myTags"
uri="uri/of/my/tld” %>
– The prefix attribute specifies the prefix part of the tag
(<myTags:someTag/>).
– The uri attribute tells the name of a TLD describing
the tags.
80. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 80
To Write Your Own Tags
• There are many useful tags in JSTL.
• There are many third party taglibs, for example
Jakarta Tagblibs.
• Sometimes we still have to write new tags, there
are two types:
– Tag files look like ordinary JSPs but are called like
custom tags.
– Tag handlers are written in Java code.
– Only the latter are covered here.
81. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 81
A Simple Tag
• The Java tag handler:
package se.kth.timetags;
import java.io.IOException;
import java.util.Date;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
* A tag that displays the current date and time.
*/
public class DateTimeTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
out.print(new Date());
}
}
– The tag handler class must extend
javax.servlet.jsp.tagext.SimpleTagSupport
82. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 82
A Simple Tag, Cont'd
• The Java tag handler:
package se.kth.timetags;
import java.io.IOException;
import java.util.Date;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
* A tag that displays the current date and time.
*/
public class DateTimeTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
out.print(new Date());
}
}
– The output of public void doTag() will be inserted in the
JSP's response.
83. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 83
A Simple Tag, Cont'd
• The tag library descriptor:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web
jsptaglibrary_2_0.xsd" version="2.0"
>
<tlib-version>1.0</tlib-version>
<uri>timeTags</uri>
<tag>
<name>date-time</name>
<tag-class>course6b4056.timetags.DateTimeTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
– Simply copy this part.
– The version of the tag. Any value can be used.
84. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 84
A Simple Tag, Cont'd
• The tag library descriptor:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web
jsptaglibrary_2_0.xsd" version="2.0"
>
<tlib-version>1.0</tlib-version>
<uri>timeTags</uri>
<tag>
<name>date-time</name>
<tag-class>course6b4056.timetags.DateTimeTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
– The name of the taglib. Must be the same as the uri in
the taglib directive in the JSP. The uri is only a string, it
is not interpreted in any way.
85. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 85
A Simple Tag, Cont'd
• The tag library descriptor:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web
jsptaglibrary_2_0.xsd" version="2.0"
>
<tlib-version>1.0</tlib-version>
<uri>timeTags</uri>
<tag>
<name>date-time</name>
<tag-class>course6b4056.timetags.DateTimeTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
– The name of the tag.
86. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 86
A Simple Tag, Cont'd
• The tag library descriptor:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web
jsptaglibrary_2_0.xsd" version="2.0"
>
<tlib-version>1.0</tlib-version>
<uri>timeTags</uri>
<tag>
<name>date-time</name>
<tag-class>course6b4056.timetags.DateTimeTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
– The name of the Java tag handler.
– The allowed content of the tags body.
87. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 87
A Simple Tag, Cont'd
• Possible values of body-content in the tld:
– empty means the tag must not have a body.
– tagdependent means the body content is not interpreted
by the JSP. Its content is handled as plain text.
– scriptless means the body may contain EL but not Java
code. EL statements are interpreted.
88. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 88
A Simple Tag, Cont'd
• The JSP:
<%@ taglib uri="timeTags" prefix="time" %>
<html>
<head>
<title>Clock</title>
</head>
<body>
<h1>Clock</h1>
<h3><time:date-time/>
</body>
</html>
– The name of the tld. Must be the same as in uri in the
TLD. The uri is not interpreted in any way.
– The prefix in the JSP.
– The name of the tag. Must be the same as in name in
the TLD.
89. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 89
A Simple Tag, Cont'd
• The compiled Java class should be placed under
WEB-INF/classes in a directory matching the
package name. The example class is in the
package se.kth.timetags and should thus be
placed in the directory
WEB-INF/classes/se/kth/timetags
• The TLD should be placed in WEB-INF.
90. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 90
Where do the container look for tag
libraries?
• A tag library and its tag handlers are defined by
the TLD.
• To execute a tag the container must find a TLD
with the same uri as in the taglib directive in the
JSP with the tag.
91. Lecture 11: JavaServer Faces (JSF), JavaServer Pages (JSP) 91
Where do the container look for tag
libraries? Cont'd
• The container looks for TLDs in these places:
– WEB-INF
– Directories under WEB-INF
– META-INF in jar files in WEB-INF/lib
– Directories under META-INF in jar files in WEB-
INF/lib