This document outlines the contents of a book on Java/J2EE interview questions and answers. It covers key topics like Java language fundamentals, Swing, Applets, J2EE, Servlets, JSP, EJB, JDBC, XML and more. The book provides sample questions and answers on these topics that may be asked in interviews. It also has sections on emerging technologies, sample questions, and how to approach common tasks like application design, documentation, performance tuning and security. The goal is to help readers prepare for Java/J2EE related job interviews.
The document contains 60 interview questions and answers related to Java. Some key topics covered include:
- The Java Virtual Machine (JVM) and differences between JDK and JVM
- Platform independence and access modifiers in Java
- Inheritance, polymorphism, and abstraction
- Exceptions and exception handling
- Threads and concurrency
- JDBC and database connectivity
- Servlets, JSP, and web technologies
- Object-oriented programming concepts like classes, objects, methods, and constructors.
The questions progress from basic Java concepts to more advanced topics like RMI, EJBs, and memory management.
BEA Weblogic Interview Questions And Answers provides a guide to preparing for a BEA Weblogic job interview. It includes sample questions and answers about BEA Weblogic, such as what BEA Weblogic is, why polymorphic responses are not allowed from create() or find() methods in EJBs, and how to set up the CLASSPATH correctly. The document provides explanations and recommendations for various BEA Weblogic concepts and configuration issues.
A Java professional with 8 years of experience in designing web applications. Made use of j2ee, mvc design pattern with spring and struts 2 frameworks. Ajax and JQuery experience in single page web applicatrions. Angular JS for bringing in lightweight on applications
java tutorial for beginner - Free DownloadTIB Academy
TIB Academy offering Java tutorial with fundamental for beginner This Java Tutorial going to explain about the fundamentals of Core Java Concepts, you can download Java tutorial as PPT for free of cost
Java training noida hibernate+spring+struts+web services(1)miracleindia
Miracle India is a leading Java Training institute having sound expertise in java applications. We pride ourselves for providing hands-on training to budding java developers and our dedicated and experienced faculty proffers intensive training on all core and general aspects of Java development. The training programs are conducted by real-time Java application developer having sound knowledge and extensive experience
This document outlines the contents of a book on Java/J2EE interview questions and answers. It covers key topics like Java language fundamentals, Swing, Applets, J2EE, Servlets, JSP, EJB, JDBC, XML and more. The book provides sample questions and answers on these topics that may be asked in interviews. It also has sections on emerging technologies, sample questions, and how to approach common tasks like application design, documentation, performance tuning and security. The goal is to help readers prepare for Java/J2EE related job interviews.
The document contains 60 interview questions and answers related to Java. Some key topics covered include:
- The Java Virtual Machine (JVM) and differences between JDK and JVM
- Platform independence and access modifiers in Java
- Inheritance, polymorphism, and abstraction
- Exceptions and exception handling
- Threads and concurrency
- JDBC and database connectivity
- Servlets, JSP, and web technologies
- Object-oriented programming concepts like classes, objects, methods, and constructors.
The questions progress from basic Java concepts to more advanced topics like RMI, EJBs, and memory management.
BEA Weblogic Interview Questions And Answers provides a guide to preparing for a BEA Weblogic job interview. It includes sample questions and answers about BEA Weblogic, such as what BEA Weblogic is, why polymorphic responses are not allowed from create() or find() methods in EJBs, and how to set up the CLASSPATH correctly. The document provides explanations and recommendations for various BEA Weblogic concepts and configuration issues.
A Java professional with 8 years of experience in designing web applications. Made use of j2ee, mvc design pattern with spring and struts 2 frameworks. Ajax and JQuery experience in single page web applicatrions. Angular JS for bringing in lightweight on applications
java tutorial for beginner - Free DownloadTIB Academy
TIB Academy offering Java tutorial with fundamental for beginner This Java Tutorial going to explain about the fundamentals of Core Java Concepts, you can download Java tutorial as PPT for free of cost
Java training noida hibernate+spring+struts+web services(1)miracleindia
Miracle India is a leading Java Training institute having sound expertise in java applications. We pride ourselves for providing hands-on training to budding java developers and our dedicated and experienced faculty proffers intensive training on all core and general aspects of Java development. The training programs are conducted by real-time Java application developer having sound knowledge and extensive experience
These question are the basic questions for Interview based on Java language. These questions are able to crack the interview based on java language
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
This document provides an introduction to object oriented programming in Java. It outlines the course objectives which are to learn Java basics, object oriented principles, Java APIs, exception handling, files, threads, applets and swings. It discusses key characteristics of Java including being portable, object oriented and having automatic memory management. It also provides an overview of Java environments and tools, and includes an example "Hello World" Java program.
This document provides an introduction and overview of the Java programming language presented by Ravi Kant Sahu. It defines Java as an object-oriented language based on C++ that is designed for easy web and internet applications. The key characteristics of Java discussed include being simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, and dynamic. The principles of object-oriented programming such as encapsulation, inheritance, and polymorphism are also explained.
This document provides an overview of Java concepts including its history, characteristics, development process, similarities to Ruby, and key concepts like objects, variables, classes, constructors, methods, and exception handling. It discusses installing Java, the JDK, and an IDE, then delves into examples to demonstrate objects, variables, classes, constructors, methods in both Java and Ruby to highlight their similarities and differences.
9 crucial Java Design Principles you cannot missMark Papis
Encapsulation, Polymorphism, Agreggation / Composition, Overloading, Inheritance vs Composition, DRY, Dependency Injection, Delagation, Law of demeter, Principle of leas knowledge,
This document provides an overview of a Java/J2EE training course that covers 8 weeks of material. Week 1 covers core Java topics like object-oriented programming concepts, the Java language fundamentals, and Java statements. Week 2 delves deeper into advanced Java features. Weeks 3 and 4 cover exception handling, multithreading, SQL, JDBC, and collections. Weeks 5-7 cover key J2EE specifications and frameworks like Servlets, JSP, EJB, Struts, Hibernate, Spring, and web services. Week 8 discusses application packaging and deployment. The document provides contact information for the training provider.
The document is a chapter from a book on Java programming in Hindi. It discusses data types in Java, including integer, float, character, and boolean types. It explains that data types are used to define the type of data variables can hold in a Java program. The chapter then provides brief descriptions of each of the main data types in Java.
JDBC is a Java API that allows Java programs to connect to databases. It includes interfaces, classes, and drivers. The document discusses JDBC architecture and components like drivers, interfaces, and classes. It also explains the steps to connect to a database like MySQL using JDBC - registering the driver class, getting a connection, creating statements, executing queries, and closing the connection. Additional topics covered include prepared statements and result sets.
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Edureka!
This Edureka Java Training tutorial will help you in understanding the core fundamentals of Java. It helps you to learn following topics:
1) Introduction to Java
2) Java Timeline
3) Features of Java
4) How does Java work?
5) Data Types in Java
6) Operators in Java
7) Functions in Java
8) Object Oriented Concepts in Java
Dev labs alliance top 20 basic java interview question for sdetdevlabsalliance
The document provides 20 basic Java interview questions for software development engineers in test (SDET) roles. The questions cover topics such as Java access specifiers, object-oriented programming principles, the differences between classes and interfaces, exception handling, threads, collections, and more. The questions are multiple choice or short answer and include explanations of concepts in Java.
This document discusses properties and binding in JavaFX 2.0. It provides an overview of properties based on the JavaBeans model and how they are expanded in JavaFX. It describes the high-level and low-level binding APIs, with the high-level API providing simple bindings for common cases and the low-level API providing more flexibility. Examples are provided to demonstrate properties and binding functionality.
This document discusses object-oriented programming (OOP) concepts like classes, objects, encapsulation, inheritance, and polymorphism. It explains that OOP improves code reusability, modularity, and maintenance by encapsulating data and methods together as objects. Some benefits of OOP include improved communication, seamless design to implementation, and code reuse through inheritance. Potential drawbacks include increased complexity, overhead from derived classes implementing base class functionality, and a high learning curve.
J2EE (Java 2 Platform, Enterprise Edition) is a platform for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications. It uses a distributed multi-tiered application model where application logic is divided into components running on different machines depending on their function. Components include web components, enterprise beans running business logic on the server, and application clients running on the client. The J2EE platform provides containers that manage these components and offer underlying services like transaction management, security, and connectivity.
Introduction to Basic Java Versions and their featuresAkash Badone
Java was developed by Sun Microsystems in 1990 and officially released in 1995. It can be used to create a variety of applications, including desktop programs, web apps, and programs for portable devices. Java applications are classified based on their orientation, such as object-oriented or procedural programming. The Java platform also supports different computing hardware systems and has released several versions with new features over time.
1. The document discusses the history and evolution of the Java programming language, created by James Gosling at Sun Microsystems in 1995.
2. It provides an overview of Java editions including J2SE for desktop apps, J2ME for mobile apps, and J2EE for server-side enterprise apps.
3. The document also lists some key features of the Java language like being object-oriented, portable, distributed, and provides examples of how Java is used in daily life including in mobile phones, web servers, and enterprise applications.
Java programming language which was developed with an initiative to write once and run anywhere is virtually the base of every networked application. Java is one of the most popular programming languages today used for developing mobile applications, games, Web-based content and enterprise software. By TOPS Technologies. http://www.tops-int.com
This document contains the chat log from an English learning room. Various students and the teacher Bac_Don discuss English grammar lessons and greet each other. A new student Khoatmr joins but says they do not have a microphone to participate fully in the lesson. Other students provide advice on how to prepare for future lessons.
The document provides information on a case study presentation for a 4-year old patient with asthma and acute exacerbation. It includes:
- The patient's history of presenting with a cough and difficulty breathing and being found lethargic on examination.
- Diagnosis of asthma with acute exacerbation and RSV infection.
- The patient's growth development according to Erikson's stages and normal physical characteristics for their age.
- Medical interventions including treatments, medications, and diagnostic tests.
- Common patient problems like ineffective airway clearance and altered nutrition along with relevant nursing interventions.
These question are the basic questions for Interview based on Java language. These questions are able to crack the interview based on java language
Learn more at blog : --
https://solutionbyexpert.blogspot.com/2020/08/become-expert-secret-of-success-ii.html
#coding
#coding development skill program
#java
This document provides an introduction to object oriented programming in Java. It outlines the course objectives which are to learn Java basics, object oriented principles, Java APIs, exception handling, files, threads, applets and swings. It discusses key characteristics of Java including being portable, object oriented and having automatic memory management. It also provides an overview of Java environments and tools, and includes an example "Hello World" Java program.
This document provides an introduction and overview of the Java programming language presented by Ravi Kant Sahu. It defines Java as an object-oriented language based on C++ that is designed for easy web and internet applications. The key characteristics of Java discussed include being simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, and dynamic. The principles of object-oriented programming such as encapsulation, inheritance, and polymorphism are also explained.
This document provides an overview of Java concepts including its history, characteristics, development process, similarities to Ruby, and key concepts like objects, variables, classes, constructors, methods, and exception handling. It discusses installing Java, the JDK, and an IDE, then delves into examples to demonstrate objects, variables, classes, constructors, methods in both Java and Ruby to highlight their similarities and differences.
9 crucial Java Design Principles you cannot missMark Papis
Encapsulation, Polymorphism, Agreggation / Composition, Overloading, Inheritance vs Composition, DRY, Dependency Injection, Delagation, Law of demeter, Principle of leas knowledge,
This document provides an overview of a Java/J2EE training course that covers 8 weeks of material. Week 1 covers core Java topics like object-oriented programming concepts, the Java language fundamentals, and Java statements. Week 2 delves deeper into advanced Java features. Weeks 3 and 4 cover exception handling, multithreading, SQL, JDBC, and collections. Weeks 5-7 cover key J2EE specifications and frameworks like Servlets, JSP, EJB, Struts, Hibernate, Spring, and web services. Week 8 discusses application packaging and deployment. The document provides contact information for the training provider.
The document is a chapter from a book on Java programming in Hindi. It discusses data types in Java, including integer, float, character, and boolean types. It explains that data types are used to define the type of data variables can hold in a Java program. The chapter then provides brief descriptions of each of the main data types in Java.
JDBC is a Java API that allows Java programs to connect to databases. It includes interfaces, classes, and drivers. The document discusses JDBC architecture and components like drivers, interfaces, and classes. It also explains the steps to connect to a database like MySQL using JDBC - registering the driver class, getting a connection, creating statements, executing queries, and closing the connection. Additional topics covered include prepared statements and result sets.
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Edureka!
This Edureka Java Training tutorial will help you in understanding the core fundamentals of Java. It helps you to learn following topics:
1) Introduction to Java
2) Java Timeline
3) Features of Java
4) How does Java work?
5) Data Types in Java
6) Operators in Java
7) Functions in Java
8) Object Oriented Concepts in Java
Dev labs alliance top 20 basic java interview question for sdetdevlabsalliance
The document provides 20 basic Java interview questions for software development engineers in test (SDET) roles. The questions cover topics such as Java access specifiers, object-oriented programming principles, the differences between classes and interfaces, exception handling, threads, collections, and more. The questions are multiple choice or short answer and include explanations of concepts in Java.
This document discusses properties and binding in JavaFX 2.0. It provides an overview of properties based on the JavaBeans model and how they are expanded in JavaFX. It describes the high-level and low-level binding APIs, with the high-level API providing simple bindings for common cases and the low-level API providing more flexibility. Examples are provided to demonstrate properties and binding functionality.
This document discusses object-oriented programming (OOP) concepts like classes, objects, encapsulation, inheritance, and polymorphism. It explains that OOP improves code reusability, modularity, and maintenance by encapsulating data and methods together as objects. Some benefits of OOP include improved communication, seamless design to implementation, and code reuse through inheritance. Potential drawbacks include increased complexity, overhead from derived classes implementing base class functionality, and a high learning curve.
J2EE (Java 2 Platform, Enterprise Edition) is a platform for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications. It uses a distributed multi-tiered application model where application logic is divided into components running on different machines depending on their function. Components include web components, enterprise beans running business logic on the server, and application clients running on the client. The J2EE platform provides containers that manage these components and offer underlying services like transaction management, security, and connectivity.
Introduction to Basic Java Versions and their featuresAkash Badone
Java was developed by Sun Microsystems in 1990 and officially released in 1995. It can be used to create a variety of applications, including desktop programs, web apps, and programs for portable devices. Java applications are classified based on their orientation, such as object-oriented or procedural programming. The Java platform also supports different computing hardware systems and has released several versions with new features over time.
1. The document discusses the history and evolution of the Java programming language, created by James Gosling at Sun Microsystems in 1995.
2. It provides an overview of Java editions including J2SE for desktop apps, J2ME for mobile apps, and J2EE for server-side enterprise apps.
3. The document also lists some key features of the Java language like being object-oriented, portable, distributed, and provides examples of how Java is used in daily life including in mobile phones, web servers, and enterprise applications.
Java programming language which was developed with an initiative to write once and run anywhere is virtually the base of every networked application. Java is one of the most popular programming languages today used for developing mobile applications, games, Web-based content and enterprise software. By TOPS Technologies. http://www.tops-int.com
This document contains the chat log from an English learning room. Various students and the teacher Bac_Don discuss English grammar lessons and greet each other. A new student Khoatmr joins but says they do not have a microphone to participate fully in the lesson. Other students provide advice on how to prepare for future lessons.
The document provides information on a case study presentation for a 4-year old patient with asthma and acute exacerbation. It includes:
- The patient's history of presenting with a cough and difficulty breathing and being found lethargic on examination.
- Diagnosis of asthma with acute exacerbation and RSV infection.
- The patient's growth development according to Erikson's stages and normal physical characteristics for their age.
- Medical interventions including treatments, medications, and diagnostic tests.
- Common patient problems like ineffective airway clearance and altered nutrition along with relevant nursing interventions.
This document discusses transverse stability at large angles of heel for ships. It begins by explaining that while metacentric height is a useful measure of stability for small angles of heel, righting moment must be considered for larger angles. The document then covers righting arms and moments, cross curves of stability, statical stability curves, and the impact of factors like deck immersion and the center of gravity on stability. It also provides an example of the stability behavior of an idealized circular cylindrical body. In summary, it analyzes ship stability at angles beyond initial upright and identifies key metrics for evaluating stability at larger inclinations.
Bonds are debt instruments issued by organizations and governments to borrow money. Bondholders are lenders who receive interest payments until the bond matures, at which point the principal is returned. The main types of bonds are zero-coupon bonds, floating rate bonds, callable bonds, puttable bonds, convertible bonds, and amortizing bonds. People invest in bonds to earn interest income and save on taxes. The tax treatment of bond returns depends on the type of bond and whether the investor realizes capital gains or losses upon selling.
The document is a newsletter from the University of Georgia Career Center announcing various career workshops, information sessions, internship opportunities and deadlines for campus interviews. It provides information on workshops for creating resumes and improving interview skills, as well as information sessions from employers like Deloitte and internship opportunities with local companies. Deadlines are given for submitting resumes for upcoming campus interviews. Links are also provided for homework and tutoring help.
Laporan kasus ini membahas seorang anak laki-laki berusia 11 tahun yang dirawat karena status epileptikus yang diderita sejak 2 hari sebelum masuk rumah sakit. Anak ini memiliki riwayat kejang sejak bayi dan perkembangan fisik tertinggal. Berdasarkan pemeriksaan fisik dan penunjang, didiagnosis menderita status epileptikus, gizi kurang, mikrocephali dan retardasi mental. Penatalaksanaan yang diberikan melip
Respondent judge is accused of two acts of misconduct. First, he solemnized a marriage where the groom was still legally married, without a legal declaration of the previous wife's presumptive death. Second, he performed a marriage ceremony outside of his court's jurisdiction in the municipality of Dapa, when his jurisdiction was only the municipalities of Sta. Monica and Burgos. The Supreme Court found the respondent judge guilty of gross ignorance of the law for both acts, as he failed to properly understand and apply the legal principles of marriage and a judge's authority under the Family Code.
The document provides an overview of a presentation on core Java concepts including details about the Encapsulate Logics institute where the presentation will take place, background on Java founder James Gosling, definitions and characteristics of Java, and versions of the Java Development Kit. Key aspects of object-oriented programming such as encapsulation, inheritance, and polymorphism are also explained. The presentation aims to impart programming skills and practical concepts of Java to students.
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language. Writing, compiling and debugging a program is easy in java. It helps to create modular programs and reusable code.
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language. Writing, compiling and debugging a program is easy in java. It helps to create modular programs and reusable code.
AchieversIT - Provides a wide group of opportunities for freshers and Experienced candidates who can develop their skills and build their career opportunities across multiple Companies.
A Java full-stack developer is proficient in both front-end and back-end development using Java. They are responsible for all aspects of development from UI/UX design to database design. The document outlines the basics of becoming a Java full-stack developer including understanding Java, setting up development environments, object-oriented programming, database modeling, creating front-end and back-end, testing, and deployment. It also describes a Java full-stack course that covers these topics to prepare students for careers as Java full-stack developers.
AchieversIT - Provides a wide group of opportunities for freshers and Experienced candidates who can develop their skills and build their career opportunities across multiple Companies.
This document is an industrial training report submitted by students to fulfill the requirements of a Bachelor of Technology degree in computer science and engineering. It contains an introduction to key Java concepts such as what Java is, its basic syntax including identifiers, arrays, enums, and keywords. It also discusses object-oriented programming concepts in Java like inheritance, interfaces, constructors, and access specifiers. The report is divided into chapters that cover these concepts in further detail along with other OOP principles like polymorphism and abstraction.
This document provides an overview of the Java programming language. It discusses the history and origins of Java, defines what Java is, and lists some of its common uses. It then provides reasons for using Java, including that it works on multiple platforms, is one of the most popular languages, is easy to learn, is open-source, and has a large community. The document also introduces key Java concepts like syntax, variables, data types, classes and objects, inheritance, and packages.
Object-Oriented Programming in Java
Java is a well-liked programming language that may be used to create a wide range of applications, from straightforward desktop programs to intricate web programs. It is an object-oriented programming language that enables programmers to create modular, reusable code, making it simple to maintain and update.
We shall look at the fundamentals of Java object-oriented programming in this tutorial. The fundamentals of object-oriented programming in Java, oops concepts such as classes and objects, inheritance, polymorphism, and encapsulation will all be covered. You will have a solid understanding of object-oriented programming in Java and how to use it to create robust and scalable programs at the end of this article.
Introduction to OOPs concept
Object-oriented programming in Java is a programming paradigm that revolves around objects. An object is a real-world entity that has a set of attributes and behaviors. In Java, even basic data types like integers and booleans are considered objects.
In OOPS, a program is designed by creating objects that interact with each other to perform tasks. Objects have attributes that define their properties and methods that define their behavior.
In Java, we create classes, which are templates that define the attributes and behaviors of objects. A class can be compared to an object creation blueprint. Once a class is defined, objects can be created based on that class.
Principles of Object-Oriented Programming
There are four main principles of object-oriented programming:
a. Abstraction
Abstraction is the process of hiding complex details and providing a simplified interface for the user. It helps developers to create simpler and more understandable models of a complex system, by just exposing only the required features and not the implementation part. In Java, abstraction can be achieved using interfaces and abstract classes.
b. Encapsulation
Encapsulation is the process of hiding the internal details of an object and providing a public interface for accessing and modifying the object. It helps in maintaining the integrity of the object and ensures that its internal state cannot be modified by external code. In Java, encapsulation can be achieved using access modifiers such as public, private, and protected.
Got confused between Abstraction and Encapsulation?
Abstraction is about simplifying the complexity of a system by focusing on its essential features, while encapsulation is about protecting the integrity of an object by hiding its internal details.
c. Inheritance
The process of creating a new class from an existing one is called Inheritance. The new class inherits the attributes and behaviors of the existing class and can add additional attributes and behaviors. This helps in reducing code duplication, promoting code reuse, and making the code more modular and maintainable. In Java, the extend keyword is useful for achieving inheritance.
d. Polymorphism
The ability of an
This document provides an overview of a presentation on Java fundamentals by Kunal V. Gadhi. It covers topics such as the history and features of Java, object-oriented programming concepts, Java applications and applets, multithreading, input/output and networking, MySQL, and JDBC. The document includes sections on each topic with descriptions of key concepts and code examples.
We explained about important concepts such as OOPs, Data types, Variables, Constants, Constructors, Interfaces, Packages, Exceptional handling, Applets, Streams, Serialization, Multithreading, Collection Frameworks, Network Programming, Design Patterns, String handling and JVM.
This document provides information about Java programming questions that are commonly asked in interviews and exams. It lists 30 Java programming questions and their answers on topics like OOPs concepts, multithreading, exceptions, JDBC, serialization and more. The document also provides links to connect with the authors on social media and messaging platforms like WhatsApp, Telegram, Facebook, Twitter etc. for any doubts or feedback. It reminds the reader to practice all the questions well to build a clear understanding of concepts and score well in exams.
Inheritance in java introduces the concept of reusability by implementing a mechanism in which one object acquires all the properties and behaviors of the parent object.
Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming system).
The idea behind inheritance in Java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of the parent class. Moreover, you can add new methods and fields in your current class also.
Inheritance represents the IS-A relationship which is also known as a parent-child relationship.
Constructors cannot be made final as they are needed to create object instances and initialize class data. Constructors are similar to methods but cannot be directly invoked via method calls. The APK file format is an Android application package used for distribution and installation of Android apps. It is a zip file containing compiled code, resources, manifest, and other assets. Java is a popular object-oriented programming language that is portable and platform independent due to its compile-once-run-anywhere nature.
This document provides an introduction to Java fundamentals and object-oriented programming concepts. It outlines the course objectives which include learning Java features, OOP principles, and how to program using the Java API. The document then discusses Java basics like its history and importance, differences between Java and C/C++, Java characteristics, environment, and execution model. It also demonstrates a simple "Hello World" Java program and how to run it.
This document provides an introduction to Java fundamentals and object-oriented programming concepts. It outlines the course objectives which include learning Java features, OOP principles, and how to program using the Java API. The document then discusses Java basics like its history and importance, differences between Java and C/C++, Java characteristics, environment, and execution model. It also demonstrates a simple "Hello World" Java program and how to run it.
This document provides an introduction to Java fundamentals and object-oriented programming concepts. It outlines the course objectives which include learning Java features, OOP principles, and how to program using the Java API. The document then discusses Java basics like its history and importance, differences between Java and C/C++, Java characteristics, environment, and execution model. It also includes an example "Hello World" Java program and how to run it.
The document discusses Java annotations and JDBC. It begins by defining annotations and describing several built-in Java annotations like @Override, @Deprecated, and @SuppressWarnings. It then covers user-defined or custom annotations. The document also provides an overview of JDBC architecture and drivers, and describes the essential steps to connect to a database and execute queries using JDBC, including using prepared statements and result sets. It concludes with sections on batch updates and an interactive SQL tool.
This document provides an introduction to object-oriented programming using Java. It outlines the course objectives, which are to learn Java basics, inheritance, data structures, exception handling, and GUI programming. It then discusses key aspects of Java like its history and importance, differences from C and C++, characteristics, environment, and execution model. Finally, it demonstrates a simple "Hello World" Java program and its execution.
This document provides an introduction to object-oriented programming using Java. It outlines the course objectives, which are to learn Java basics, inheritance, data structures, exception handling, and GUI programming. It then discusses key aspects of Java like its importance and differences from C/C++, characteristics, environment, and execution model. Finally, it demonstrates a simple "Hello World" Java program and its execution.
This document provides an overview of the business process outsourcing (BPO) industry. It discusses the growth of the global BPO market, with India emerging as a major hub due to its large English-speaking workforce and lower costs compared to countries like the US. The document outlines the advantages that have made India and other countries like the Philippines competitive locations for BPO. It also notes some of the challenges that countries face in attracting BPO work, such as China's smaller English-speaking population.
This case study examines the success of IKEA's expansion into the American market. Key factors in IKEA's success include its Scandinavian designs, cost efficiency through flat packaging and customer assembly, and structured product strategy using a pricing matrix. While shopping at IKEA has downsides like durability issues and assembly requirements, the company aims to build partnerships with customers. IKEA plans to open 50 stores in the US by 2013, which some see as optimistic but achievable given their value proposition. Minor adjustments to the pricing matrix and additional product styles and price points could support IKEA's continued growth goals. Expanding into smaller "IKEA Lite" stores is also proposed to increase accessibility and impulse purchases.
- Judge Adoracion Angeles charged lawyer Thomas Uy with violating his fiduciary duties by failing to promptly return 16,500 pesos paid to him in trust for his client, Primitiva Del Rosario. During a court hearing, Del Rosario said she did not receive the money from Uy. Uy was then ordered to return the money but failed to do so.
- In his comment, Uy explained that the money was paid to his office by Norma Trajano on December 14, 1998 to settle the civil aspect of a criminal case. He claims Primitiva Del Rosario asked for the money to be kept in his office until further payments were made. However, during a February 10,
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
This presentation was provided by Rebecca Benner, Ph.D., of the American Society of Anesthesiologists, for the second session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session Two: 'Expanding Pathways to Publishing Careers,' was held June 13, 2024.
How Barcodes Can Be Leveraged Within Odoo 17Celine George
In this presentation, we will explore how barcodes can be leveraged within Odoo 17 to streamline our manufacturing processes. We will cover the configuration steps, how to utilize barcodes in different manufacturing scenarios, and the overall benefits of implementing this technology.
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxEduSkills OECD
Iván Bornacelly, Policy Analyst at the OECD Centre for Skills, OECD, presents at the webinar 'Tackling job market gaps with a skills-first approach' on 12 June 2024
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...indexPub
The recent surge in pro-Palestine student activism has prompted significant responses from universities, ranging from negotiations and divestment commitments to increased transparency about investments in companies supporting the war on Gaza. This activism has led to the cessation of student encampments but also highlighted the substantial sacrifices made by students, including academic disruptions and personal risks. The primary drivers of these protests are poor university administration, lack of transparency, and inadequate communication between officials and students. This study examines the profound emotional, psychological, and professional impacts on students engaged in pro-Palestine protests, focusing on Generation Z's (Gen-Z) activism dynamics. This paper explores the significant sacrifices made by these students and even the professors supporting the pro-Palestine movement, with a focus on recent global movements. Through an in-depth analysis of printed and electronic media, the study examines the impacts of these sacrifices on the academic and personal lives of those involved. The paper highlights examples from various universities, demonstrating student activism's long-term and short-term effects, including disciplinary actions, social backlash, and career implications. The researchers also explore the broader implications of student sacrifices. The findings reveal that these sacrifices are driven by a profound commitment to justice and human rights, and are influenced by the increasing availability of information, peer interactions, and personal convictions. The study also discusses the broader implications of this activism, comparing it to historical precedents and assessing its potential to influence policy and public opinion. The emotional and psychological toll on student activists is significant, but their sense of purpose and community support mitigates some of these challenges. However, the researchers call for acknowledging the broader Impact of these sacrifices on the future global movement of FreePalestine.
This document provides an overview of wound healing, its functions, stages, mechanisms, factors affecting it, and complications.
A wound is a break in the integrity of the skin or tissues, which may be associated with disruption of the structure and function.
Healing is the body’s response to injury in an attempt to restore normal structure and functions.
Healing can occur in two ways: Regeneration and Repair
There are 4 phases of wound healing: hemostasis, inflammation, proliferation, and remodeling. This document also describes the mechanism of wound healing. Factors that affect healing include infection, uncontrolled diabetes, poor nutrition, age, anemia, the presence of foreign bodies, etc.
Complications of wound healing like infection, hyperpigmentation of scar, contractures, and keloid formation.
A Visual Guide to 1 Samuel | A Tale of Two HeartsSteve Thomason
These slides walk through the story of 1 Samuel. Samuel is the last judge of Israel. The people reject God and want a king. Saul is anointed as the first king, but he is not a good king. David, the shepherd boy is anointed and Saul is envious of him. David shows honor while Saul continues to self destruct.
1. Get Homework/Assignment Done
Homeworkping.com
Homework Help
https://www.homeworkping.com/
Research Paper help
https://www.homeworkping.com/
Online Tutoring
https://www.homeworkping.com/
click here for freelancing tutoring sites
A Training Report On
J2EE
2. A Training Report submitted in partial
fulfillment of requirements for the degree of
BachelorofEngineering
In
Computer Science & Engineering
PREFACE
3. This report deals with programming in java and in particular advanced java.
Each and every topic is kept in proper sequence with thorough planning. The
details of every topic are explained as simply as possible.
We hope that the project will find greater appreciation among different readers and
teachers about its usefulness. It would be my sane opportunity to know if any
mistakes have crept in to the script.
Acknowledgement
4. I acknowledge my gratitude and thank to all the well knowledge persons for giving
me opportunity to avail all the best facilities available at HWELLET -PACKARD
EDUCATION SERVICE through which I have gained knowledge thinking so as
too just in the environment suitable for harmonic adjustment.
I express my deep sense of gratitude to, Mr. Harish Kumar Advisor and Trainer
for his valuable guidance and constant unfailing encouragement for completing the
summer course.
I would like to thank Mr. ShashikantRanjan for their help and support for
completing my summer course and project at HPES.
Last but not the least; I thank my teacher, friends and my family members for their
constant encouragement.
Abstract
5. The Java 2 Platform, Enterprise Edition (J2EE) defines the standard for developing
multitier enterprise applications. The J2EE platform simplifies enterprise
applications by basing them on standardized, modular components, by providing a
complete set of services to those components, and by handling many details of
application behavior automatically, without complex programming. The J2EE
platform takes advantage of many features of the Java 2 Platform, Standard Edition
(J2SE), such as "Write Once, Run Anywhere" portability, JDBC API for database
access, CORBA technology for interaction with existing enterprise resources, and
a security model that protects data even in internet applications. Building on this
base, the Java 2 Platform, Enterprise Edition adds full support for Enterprise
JavaBeans components, Java Servlets API, Java Server Pages and XML
technology. The J2EE standard includes complete specifications and compliance
tests to ensure portability of applications across the wide range of existing
enterprise systems capable of supporting the J2EE platform. In addition, the J2EE
specification now ensures Web services interoperability through support for the
WS-I Basic Profile.
TABLE OF CONTENTS
1) Introduction………………………………………………………………..6
6. 2) Basics of Core Java………………………………………………………..7
a. Static Members: Static Methods & Static Variables………………10
b. Life Cycle of a Thread……………………………………………..11
c. Java - Exception Handling………………………………………..12
d. Creating Strings…………………………………………………....13
3) Enterprise Application Model……………………………………………15
4) Introduction to JDBC…………………………………………………….16
a. JDBC API Overview………………………………………………16
b. Advantages of JDBC Technology………………………………...16
c. Key Features………………………………………………………16
d. JDBC Architecture………………………………………………...17
e. Two-tier and Three-tier Models…………………………………...19
f. JDBC Driver Type………………………………………………...20
5) Client Servlet Interaction………………………………………………....22
a. The Benefits of Servlets…………………………………………...23
b. Servlet Application Architecture……………………………….....24
c. Lifecycle of a servlet……………………………………………...24
d. Servlet sample code…………………………………….…………26
6) JAVA SERVER PAGES………………………………………………...31
a. About JSP………………………………………………………....31
b. The Problem with Servlets………………………………………..32
c. Advantages Of JSP………………………………………………..32
d. The Anatomy of a JSP Page………………………………………33
7) STRUTS………………………………………………………………….35
8) Training Project…………………………………………………………..37
9) Conclusion………………………………………………………………..42
1. INTRODUCTION
Today's enterprises gain competitive advantage by quickly developing and
deploying custom applications that provide unique business services. Whether
7. they're internal applications for employee productivity, or Internet applications for
specialized customer or vendor services, quick development and deployment are
keyto success.
Portability and scalability are also important for long term viability. Enterprise
applications must scale from small working prototypes and test cases to complete
24x 7, enterprise-wide services, accessible by tens, hundreds, or even thousands of
clients simultaneously.
The J2EE specification also supports emerging Web Services technologies
through inclusion of the WS-I Basic Profile. WS-I Basic Profile compliance means
that the developers can build applications on the J2EE platform as Web services
that interoperate with Web services from non-J2EE compliant environments.
With simplicity, portability, scalability, and legacy integration, the J2EE platform
is the platform for enterprise solutions.
8. 2.BASICS OF CORE JAVA
Principles
There were five primary goals in the creation of the Java language:
It should be "simple, object oriented, and familiar".
It should be "robust and secure".
It should be "architecture neutral and portable".
It should execute with "high performance".
It should be "interpreted, threaded, and dynamic".
JAVA FEATURES
9. CONSTRUCTOSIN JAVA
A constructoris a special type of a method which is called automatically after the
creation of object of its class. We mainly use the constructors to initialize the
variables perform some specific type of tasks such as opening a file or starting a
thread. There are some rules which should be followed during creating the
constructors and they are :
1. The constructorcannot have a return type.
2. The name of the constructorshould be the same as of its class.
3. The access specifier to the constructor must be public to create an object of
the class. If the access specifier is private you are not able to create the
object of the class.
The basic declaration for constructoris :
public class Constructordemo
{
Public constructordemo()
{
}
}
INHERITANCE
Inheritance is a powerful aspectof object-oriented programming that allows
you to easily reuse codeand extend the functionality of existing classes. Using
this aspectof object-oriented programming, you can create a new class that
inherits the functionality of an existing class. You can then extend the functions
of the old class in ways that suit your current needs.
In JAVA, inheritance is done by creating new classes that are extensions of
other classes. The new class is known as a subclass. The original class is known
as a super class. The subclass has all the attributes of the super class, and in
addition has attributes that it defines itself.
General form of inheritance-
Class subclass extend super-class
10. {
//body of the class
}
Types of Inheritance-Although there are 3 types of inheritance but CPP supports
only following Types of Inheritance. These are followings-
Single Inheritance
Multilevel Inheritance
Hierarchical Inheritance
Single Inheritance-Inheritance with single Base and Derived class is called
single inheritance. Following Symbol can represent it.
Multilevel Inheritance-
The method of deriving a class from another drive class is known as multi
level Inheritance.
Base class
Intermediate
Base Class
Derived class
B
C
A
11. HIERARCHICAL INHERITANCE-
We have discussed so for have inheritance can be used to modify a class when it
did not satisfy the requirements of a particular problem on hand.
Additional members are added through inheritance to extend the capabilities of a
class. Many programming problems can be coast into a hierarchy where certain
features of one level are shared by many other below that level.
StaticMembers: Static Methods and Static Variables
There are situations in which the method’s behavior does not depend on the state
of an object. So, there will be no use of having an object when the method itself
will not be instance specific.
Let us consider another situation where in we want to keep a count of all the
instances instantiated from a particular class. Supposewe declare an instance
variable to do the job, it won’t work. Its because the instance variables are
initialized back to their default value each time a instance is created. So we need
some variable which will be independent of the instances created.
The answer to both the situations is to use the “static” modifiers, in other words
static members.
What exactly are Static Variable and Methods?
Variables and methods marked static belong to the class rather than to any
particular instance of the class. These can be used without having any instances of
that class at all. Only the class is sufficient to invoke a static method or access a
static variable. A static variable is shared by all the instances of that class i.e only
one copyof the static variable is maintained.
class Animal
{
12. static int animalCount=0;
public Animal()
{
animalCount+=1;
}
public static void main(String[] args)
{
new Animal();
new Animal();
new Animal();
System.out.println(“The Number of Animals is: “+ animalCount);
}
}
The output is – “TheNumberof Animals is 3“.
THREADS In JAVA
Java provides built-in support for multithreaded programming. A multithreaded
program contains two or more parts that can run concurrently. Each part of such a
program is called a thread, and each thread defines a separate path of execution.
A multithreading is a specialized form of multitasking. Multitasking threads
require less overhead than multitasking processes.
I need to define another term related to threads: process: A process consists of the
memory space allocated by the operating system that can contain one or more
threads. A thread cannot exist on its own; it must be a part of a process. A process
remains running until all of the non-daemon threads are done executing.
Multithreading enables you to write very efficient programs that make maximum
use of the CPU, because idle time can be kept to a minimum.
13. Life Cycle of a Thread:
A thread goes through various stages in its life cycle. For example, a thread is
born, started, runs, and then dies. Following diagram shows complete life cycle of
a thread.
Java - Exceptions Handling
An exception is a problem that arises during the execution of a program. An
exception can occur for many different reasons, including the following:
A user has entered invalid data.
A file that needs to be opened cannot be found.
A network connection has been lost in the middle of communications, or the
JVM has run out of memory.
Some of these exceptions are caused by user error, others by programmer error,
and others by physical resources that have failed in some manner.
To understand how exception handling works in Java, you need to understand the
three categories of exceptions:
14. Checked exceptions: A checked exception is an exception that is typically a
user error or a problem that cannot be foreseen by the programmer. For
example, if a file is to be opened, but the file cannot be found, an exception
occurs. These exceptions cannot simply be ignored at the time of
compilation.
Runtime exceptions: A runtime exception is an exception that occurs that
probably could have been avoided by the programmer. As opposed to
checked exceptions, runtime exceptions are ignored at the time of
compilation.
Errors: These are not exceptions at all, but problems that arise beyond the
control of the user or the programmer. Errors are typically ignored in your
code because you can rarely do anything about an error. For example, if a
stack overflow occurs, an error will arise. They are also ignored at the time
of compilation.
STRING IN JAVA
Strings, which are widely used in Java programming, are a sequence of characters.
In the Java programming language, strings are objects.
The Java platform provides the String class to create and manipulate strings.
Creating Strings:
The most direct way to create a string is to write:
String greeting = "Hello world!";
Whenever it encounters a string literal in your code, the compiler creates a String
object with its valuein this case, "Hello world!'.
As with any other object, you can create String objects by using the new keyword
and a constructor. The String class has eleven constructors that allow you to
provide the initial value of the string using different sources, such as an array of
characters:
public class StringDemo{
public static void main(String args[]){
char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.'};
15. String helloString = new String(helloArray);
System.out.println( helloString );
}
}
This would produce following result:
Hello
Note: The String class is immutable, so that once it is created a String object
cannot be changed. If there is a necessity to make alot of modifications to Strings
of characters then you should use String Buffer & String Builder Classes.
String Length:
Methods used to obtain information about an object are known as accessor
methods. One accessor method that you can use with strings is the length() method,
which returns the number of characters contained in the string object.
After the following two lines of code have been executed, len equals 17:
public class StringDemo{
public static void main(String args[]){
String palindrome = "Dot saw I was Tod";
intlen = palindrome.length();
System.out.println( "String Length is : " + len );
}
}
This would produce following result:
String Length is : 17
16. 3. EnterpriseApplicationModel of JAVA
The Enterprise Java Blueprints for the J2EE platform describe the J2EE application
model and best practices for using the J2EE platform. Building on the J2SE
platform, the J2EE application model provides a simplified approach to developing
highly scalable and highly available internet or intranet based applications. Thanks
to the J2EE application model, maybe the most interesting thing about J2EE
applications is what they don't do. That is, various complexities inherent in
enterprise applications -- transaction management, life-cycle management,
resource pooling -- are built into the platform and provided automatically to the
components it supports. Componentand application developers are free to focus on
specifics such as business logic and user interfaces.
Another advantage of the J2EE platform is that the application model encapsulates
the layers of functionality in specific types of components. Business logic is
encapsulated in Enterprise JavaBeans (EJB) components. Client interaction can be
presented through plain HTML web pages, through web pages powered by applets,
Java Servlets, or Java Server Pages technology, or through stand-alone Java
applications. Components communicate transparently using various standards:
HTML, XML, HTTP, SSL, RMI, IIOP, and others. Reusable J2EE components
mean competitive choices for enterprise developers and IT organizations. The
J2EE platform enables them to assemble applications from a combination of
standard, commercially available components and their own custom components.
From general business application components to vertical market solutions, a range
of standardized J2EE functionality is available off the shelf.
Figure 3.1 Enterprise Application Model
17. 4. INTRODUCTION TO JDBC
The Java Database Connectivity (JDBC) API is the industry standard for database-
independent connectivity between the Java programming language and a wide
range of databases. SQL databases and other tabular data sources, such as
spreadsheets or flat files. The JDBC API provides a call-level API for SQL-based
database access.
4.1 JDBC API Overview
The JDBC API makes it possible to do three things:
Establish a connection with a databaseor access any tabular data source
Send SQL statements
Process the results
4.2 Advantages of JDBC Technology
4.2.1 Leverage Existing Enterprise Data
With JDBC technology, businesses are not locked in any proprietary
architecture, and can continue to use their installed databases and access
information easily -- even if it is stored on different database management
systems.
4.2.2 Simplified Enterprise Development
The combination of the Java API and the JDBC API makes application
development easy and economical. JDBC hides the complexity of many data
access tasks, doing most of the "heavy lifting"for the programmer behind the
scenes. The JDBC API is simple to learn, easy to deploy, and inexpensive to
maintain.
4.3 KEY FEATURES
Full Access to Metadata
The JDBC API provides metadata access that enables the development of
sophisticated applications that need to understand the underlying facilities and
capabilities of a specific database connection.
No Installation
A pure JDBC technology-based driver does not require special installation; it is
automatically downloaded as part of the applet that makes the JDBC calls.
18. DatabaseConnection Identified by URL
JDBC technology exploits the advantages of Internet-standard URLs to identify
database connections. The JDBC API includes an even better way to identify and
connect to a data source, using a DataSourceobject, that makes codeeven more
portable and easier to maintain.
4.4. JDBC ARCHITECTURE
The JDBC API contains two major sets of interfaces: the first is the JDBC API for
application writers, and the second is the lower-level JDBC driver API for driver
writers. JDBC technology drivers fit into one of four categories. Applications and
applets can access databases via the JDBC API using pure Java JDBC technology-
based drivers, as shown in this figure:
Figure 4.1 JDBC Architecture1
Left side, Type 4: Direct-to-Database Pure Java Driver
This style of driver converts JDBC calls into the network protocolused directly by
DBMSs, allowing a direct call from the client machine to the DBMS server and
providing a practical solution for intranet access.
Rightside, Type 3: Pure Java Driver for DatabaseMiddleware
This style of driver translates JDBC calls into the middleware vendor's protocol,
which is then translated to a DBMS protocolby a middleware server. The
middleware provides connectivity to many different databases.
19. The graphic below illustrates JDBC connectivity using ODBC drivers and existing
database client libraries.
Figure 4.2 JDBC Architecture 2
Left side, Type 1: JDBC-ODBC BridgeplusODBC Driver
This combination provides JDBC access via ODBC drivers. ODBC binary code --
and in many cases, database client code -- must be loaded on each client machine
that uses a JDBC-ODBC Bridge. Sun provides a JDBC-ODBC Bridge driver,
which is appropriate for experimental use and for situations in which no other
driver is available.
Rightside, Type 2: A native API partly Java technology-enabled driver
This type of driver converts JDBC calls into calls on the client API for Oracle,
Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this style
of driver requires that some binary codebe loaded on each client machine.
20. 4.5 Two-tierand Three-tier Models
The JDBC API supports bothtwo-tier and three-tier models for database access.
In the two-tier model, a Java applet or application talks directly to the database.
This requires a JDBC driver that can communicate with the particular database
management system being accessed. A user's SQL statements are delivered to the
database, and the results of those statements are sent back to the user. The database
may be located on another machine to which the user is connected via a network.
This is referred to as a client/server configuration, with the user's machine as the
client, and the machine housing the database as the server. The network can be an
intranet, which, for example, connects employees within a corporation, or it can be
the Internet.
In the three-tier model, commands are sent to a "middle tier" of services, which
then send SQL statements to the database. The database processes the SQL
statements and sends the results back to the middle tier, which then sends them to
the user. MIS directors find the three-tier model very attractive because the middle
tier makes it possible to maintain control over access and the kinds of updates that
can be made to corporatedata. Another advantage is that when there is a middle
tier, the user can employ an easy-to-use higher-level API which is translated by the
middle tier into the appropriate low-level calls. Finally, in many cases the three-tier
architecture can provide performance advantages.
21. 4.6 JDBC Driver Type
The JDBC drivers that we are aware of at this time fit into one of four categories:
1. JDBC-ODBC bridgeplusODBC driver: The JavaSoft bridge product
provides JDBC access via ODBC drivers. Note that ODBC binary code, and
in many cases database client code, must be loaded on each client machine
that uses this driver. As a result, this kind of driver is most appropriate on a
corporatenetwork where client installations are not a major problem, or for
application server codewritten in Java in a three-tier architecture.
2. Native-API partly-Java driver: This kind of driver converts JDBC calls into
calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS.
Note that, like the bridge driver, this style of driver requires that some binary
codebe loaded on each client machine.
3. JDBC-Netpure Java driver: This driver translates JDBC calls into a DBMS-
independent net protocolwhich is then translated to a DBMS protocolby a
server. This net server middleware is able to connectits pure Java clients to
many different databases. The specific protocolused depends on the vendor.
4. Native-protocol pure Java driver: This kind of driver converts JDBC
calls into the network protocolused by DBMSs directly. This allows a direct
call from the client machine to the DBMS server and is a practical solution
for Intranet access.
The following chart shows the four categories and their properties:
22. DRIVER CATEGORY ALL JAVA? NET PROTOCOL
1 - JDBC-OCBC Bridge No Direct
2 - Native API as basis No Direct
3 - JDBC-Net Yes Requires Connector
4 - Native protocolas basis Yes Direct
23. 5.JAVA SERVLET TECHNOLOGY
Java Servlet technology provides a basic mechanism for generating dynamic Web
content.
Like all J2EE components, servlets run in a container implemented by the J2EE
platform provider. The container manages a servlet's interaction with its client and
provides a rich environment for the servlet to use to access various services based
on Java technology. A servlet container implements all of the Java 2 Platform,
Standard Edition APIs. This makes a variety of technologies based on the Java
programming language available to servlets, including JDBC, Java Naming and
Directory Interface, RMI, JavaBeans, and others.
The container can also implement features that allow servlets to share information
about a particular client and session, overcoming the obstacles generally presented
by the stateless HTTP protocol. The flexibility of servlets is enabled through the
servlet API, which implements a mechanism for more complex interaction with the
requesting client than can CGI. Various servlet methods provide information to the
servlet and allow it to respond. Because of the object−oriented programming
model, items key to servlet behaviors are provided as objects with a well−defined
API.
Figure 5.1 Client – servlet interaction
24. 5.1 The Benefits of Servlets
When it first emerged, this great thing we call the Internet consisted of only static
contents written using Hypertext Markup Language (HTML). At that time, anyone
who could author HTML pages was considered an Internet expert. This did not last
long, however. Soon dynamic web contents were made possible through the
Common Gateway Interface (CGI) technology. CGI enables the web server to call
an external program and pass HTTP request information to that external program
to process the request. The response from the external program is then passed back
to the web server, which forwards it to the client browser. CGI programs can be
written in any language that can be called by the web server. Over the course of
time, Perl became the most popular language to write CGI programs.
In the past, ASP and servlet/JSP have been the main technologies used in web
application development. With the release of ASP.NET, it is not hard to predict
that this technology will become the servlet/JSP's main competitor. ASP (and
ASP.NET) and servlet/JSP each have their own fans, and it is not easy to predict
which one will come out the winner. The most likely outcome is that neither will
be an absolute winner that corners the market; instead the technologies will
probably run head-to-head in the coming years. Servlet (and JSP) offers the
following benefits that are not necessarily available in other technologies:
• Performance. The performance of servlets is superior to CGI because there is no
process creation for each client request. Instead, each request is handled by the
servlet container process. After a servlet is finished processing a request, it stays
resident in memory, waiting for another request.
• Portability. Similar to other Java technologies, servlet applications are portable.
You can move them to other operating systems without serious hassles.
• Rapid development cycle. As a Java technology, servlets have access to the rich
Java library, which helps speed up the development process.
• Robustness. Servlets are managed by the Java Virtual Machine. As such, you
don't need to worry about memory leak or garbage collection, which helps you
write robust applications.
25. • Widespread acceptance. Java is a widely accepted technology. This means that
numerous vendors work on Java-based technologies. One of the advantages of this
widespread acceptance is that you can easily find and purchase components that
suit your needs, which saves precious development time.
5.2 Servlet Application Architecture
A servlet is a Java class that can be loaded dynamically into and run by a special
web server. This servlet-aware web server is called a servlet container, which also
was called a servlet engine in the early days of the servlet technology. Servlets
interact with clients via a request-response model based on HTTP. Because servlet
technology works on top of HTTP, a servlet container must support HTTP as the
protocol for client requests and server responses. However, a servlet container also
can support similar protocols, such as HTTPS (HTTP over SSL) for secure
transactions.
Figure 5.2 the Servlet Application Architecture
5.3 Lifecycle of a servlet
The servlet lifecycle consists of the following steps:
1. The servlet class is loaded by the Web container during start-up.
2. The Web container calls the init() method. This method initializes the servlet
and must be called before the servlet can service any requests. In the entire
life of a servlet, the init() method is called only once.
3. After initialization, the servlet can service client requests. Each request is
serviced in its own separate thread. The Web container calls the service()
method of the servlet for every request. The service() method determines the
kind of request being made and dispatches it to an appropriate method to
handle the request. The developer of the servlet must provide an
26. implementation for these methods. If a request for a method that is not
implemented by the servlet is made, the method of the parent class is called,
typically resulting in an error being returned to the requester. Finally, the
Web container calls the destroy() method that takes the servlet out of
service. The destroy() method, like init(), is called only once in the lifecycle
of a servlet.
Figure 5.3 ServletLifecycle
27. 5.4 Servlet sample code
importjavax.servlet.*;
importjavax.servlet.http.*;
import java.io.*;
importjava.util.*;
public class TestingServlet extends HttpServlet {
public void doGet(HttpServletRequestrequest,HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>Servlet Testing</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("Welcome to the Servlet Testing Center");
out.println("</BODY>");
out.println("</HTML>");
}
The clientside browser will have the html page of code
<html>
<bodybgcolor="white">
28. <h1>Good evening!</h1>
Welcome to our site, open 24 hours a day.
</body>
</html>
The following table summarizes the core interfaces that are provided in this
package-
Interface Description
1. HttpServletRequest
2. HttpServletResponse
3. HttpSession
Enables servlets to read data from an Http request.
Enables servlets to write data to an Http response.
Allows sessiondata to be read and written.
The following table summarizes the core classes that are provided in this package.
The most important of these is HttpServlet. Servlet developers typically extend this
class in order to process Http Requests.
Class Description
1. Cookie
2. HttpServlet
3. HttpSessionE
vent
Allows state information to be stored on a client machine.
Provides methods to handle Httprequests and responses.
Encapsulates a session changed event.
HttpServletRequests
The HttpServletRequest interface is implemented by the server. It enables a servlet
to obtain information about a client request. Extends the ServletRequest interface
to provide request information for HTTP servlets. The servlet container creates an
HttpServletRequest object and passes it as an argument to the servlet's
service methods (doGet, doPost, etc).
29. HttpServletResponse
public interface HttpServletResponse
extendsServletResponse
Extends the ServletResponse interface to provide HTTP-specific
functionality in sending a response. Forexample, it has methods to access
HTTP headers and cookies. The servlet container creates an
HttpServletResponse object and passes it as an argument to the
servlet's service methods (doGet, doPost, etc).
The HttpServletResponse interface is implemented by the server. It enables a
servlet to formulate an HTTP responseto a client. Several constants are
defined. These correspond to the different status codes that can be assigned
to an HTTP response. Forexample, SC_OKindicates that the HTTP request
succeeded and SC_NOT_FOUNDindicates that the requested resource is
not available.
HTTPSession
javax.servlet.http
Interface HttpSession
public interface HttpSession
Provides a way to identify a user across more than one page request or visit to a
Web site and to store information about that user.
The servlet container uses this interface to create a session between an HTTP client
and an HTTP server. The session persists for a specified time period, across more
than one connection or page request from the user. A sessionusually corresponds
to one user, who may visit a site many times. The server can maintain a sessionin
many ways such as using cookies or rewriting URLs.
This interface allows servlets to
View and manipulate information about a session, such as the session
identifier, creation time, and last accessed time
30. Bind objects to sessions, allowing user information to persist across multiple
user connections
When an application stores an object in or removes an object from a session, the
session checks whether the object implements HttpSessionBindingListening. If it
does, the servlet notifies the object that it has been bound to or unbound from the
session.
Session information is scoped only to the current web application
(ServletContext), so information stored in one context will not be directly
visible in another.
Cookies
A cookie, also known as an HTTP cookie, webcookie, orbrowsercookie,
is used for an origin website to send state information to a user's browser and
for the browser to return the state information to the origin site. The state
information can be used for authentication, identification of a user session,
user's preferences, shopping cart contents, or anything else that can be
accomplished through storing text data.
Cookies are not software. They cannot be programmed, cannot carry viruses,
and cannot install malware on the host computer . However, they can be
used by spyware to track user's browsing activities – a major privacy
concern that prompted European and US law makers to take actions.
Cookies could also be stolen by hackers to gain access to a victim's web
account.
java.net
Class HttpCookie
java.lang.Object
java.net.HttpCookie
All Implemented Interfaces:
Cloneable
31. An HttpCookie object represents an http cookie, which carries state information
between server and user agent. Cookie is widely adopted to create stateful sessions.
32.
33. 6. JAVA SERVER PAGES
JavaServer Pages technology builds on Java Servlet technology to simplify the
development of dynamic Web content. JSP supports a page−based metaphor that
conveniently separates dynamic and static Web content; the JSP page defines a
static HTML template, with embedded calls to code written in the Java
programming language to fill in dynamic portions of the page. JSP pages contain
four kinds of elements, each with a specific role in the presentation of dynamic
content. Text elements are normally content formatted through standard HTML or
XML. These represent the static portion of the page.
1. Directives are instructions to the JSP processor. A JSP container processes
these directives when compiling the page into an efficient executable form.
2. Tags invoke JavaBeans to generate dynamic content or perform other
computations. Tag libraries are a powerful feature of JSPs used to
encapsulate specific functionality invoked via HTML tags. These allow the
JSP _language_ to be easily extended in a portable fashion. For example, tag
libraries can be implemented to support embedded database queries for an
application.
3. Scripting elements may be declarations, scriptlets, or expressions. Like tags,
scripting elements can be used to perform computations to generate dynamic
content. They are useful when standard tags are inappropriate or have not
been defined.
4. The combination of these four elements makes it easy to generate Web
pages for client browsers. Because JSP is based on servlets, users benefit
from the application support and other features built into Web application
containers. These include portability, access to common services, the ability
to maintain state and client−access information via common APIs, and other
servlet benefits.
6.1 About jsp
Dynamic content. Unlike a plain HTML page, which contains static content that
always remains the same, a JSP page can change its content based on any number
of variable items, including the identity of the user, the user's browser type,
information provided by the user, and selections made by the user. As you'll see
later in the book, this functionality is key to web applications such as online
shopping and employee directories, as well as for personalized and
internationalized content. A JSP page contains standard markup language
34. elements, such as HTML tags, just like aregular web page. However, a JSP page
also contains special JSP elements that allow the
server to insert dynamic content in the page. JSP elements can be used for a variety
of
purposes, suchas retrieving information from a database or registering user
references. When a user asks for a JSP page, the server executes the JSP elements,
merges the results with the static parts of the page, and sends the dynamically
composed pageback to the browser.
Figure 6.1 Generating Dynamic Content with JSP
6.2 The Problem with Servlets
Thorough Java programming knowledge is needed to develop and maintain
all aspects of the application, since the processing codeand the HTML
elements are lumped together.
Changing the look and feel of the application, or adding supportfor a new
type of client (such as a WML client), requires the servlet codeto be updated
and recompiled.
It's hard to take advantage of web-page development tools when designing
the
application interface. If such tools are used to develop the web page layout,
the generated HTML must then be manually embedded into the servlet code,
a process which is time consuming, error prone, and extremely boring.
6.3 Advantages Of JSP
1. The JSP technology is platform independent, in its dynamic web pages, its web
servers, and its underlying server components. That is, JSP pages perform perfectly
without any hassle on any platform, run on any web server, and web-enabled
application server. The JSP pages can be accessed from any web server.
2. The JSP technology emphasizes the use of reusable components. These
components can be combined or manipulated towards developing more purposeful
35. components and page design. This definitely reduces development time apart from
the At development time, JSPs are very different from Servlets, however, they are
precompiled into Servlets at run time and executed by a JSP engine which is
installed on a Web-enabled application server such as BEA Web Logic and IBM
Web Sphere.
6.4 The Anatomy of a JSP Page
A JSP page is simply a regular web page with JSP elements for generating the
parts that differ for each request
Everything in the page that isn't a JSP element is called template text. Template
text can be any text: HTML, WML, XML, or even plain text. Since HTML is by
far the most common web-page language in use today, most of the descriptions and
examples in this bookuse HTML, but keep in mind that JSP has no dependency on
HTML; it can be used with any markup language. Template text is always passed
straight through to the browser.
36. When a JSP page request is processed, the template text and dynamic content
generated by the JSP elements are merged, and the result is sent as the responseto
the browser.
37. 7. Struts
Web applications differ from conventional websites in that web applications can
create a dynamic response. Many websites deliver only static pages. A web
application can interact with databases and business logic engines to customize a
response.
One way to separate concerns in a software application is to use a Model-View-
Controller (MVC) architecture. The Model represents the business or database
code, the View represents the page design code, and the Controller represents the
navigational code. The Struts framework is designed to help developers create web
applications that utilize a MVC architecture.
The framework provides three key components:
A "request" handler provided by the application developer that is mapped to
a standard URI.
A "response" handler that transfers control to another resource which
completes the response.
A tag library that helps developers create interactive form-based applications
with server pages.
7.1 Design goals and overview
In a standard Java EE web application, the client will typically submit information
to the server via a web form. The information is then either handed over to a Java
Servlet that processes it, interacts with a database and produces an HTML-
formatted response, or it is given to a JavaServer Pages (JSP) document that
intermingles HTML and Java code to achieve the same result. Both approaches are
often considered inadequate for large projects because they mix application logic
with presentation and make maintenance difficult.
The goal of Struts is to cleanly separate the model (application logic that interacts
with a database) from the view (HTML pages presented to the client) and the
controller (instance that passes information between view and model). Struts
provides the controller (a servlet known as ActionServlet) and facilitates the
writing of templates for the view or presentation layer (typically in JSP, but
XML/XSLT and Velocity are also supported). The web application programmer is
38. responsible for writing the model code, and for creating a central configuration file
struts-config.xml that binds together model, view and controller.
Requests from the client are sent to the controller in the form of "Actions" defined
in the configuration file; if the controller receives such a request it calls the
corresponding Action class that interacts with the application-specific model code.
The model code returns an "ActionForward", a string telling the controller what
output page to send to the client. Information is passed between model and view in
the form of special JavaBeans. A powerful custom tag library allows it to read and
write the content of these beans from the presentation layer without the need for
any embedded Java code. Struts also supports internationalization by web forms,
and includes a template mechanism called "Tiles" that (for instance) allows the
presentation layer to be composed from independent header, footer, and content
components.
39. TRAINING PROJECT
ONLINE LIBRARY
1.Introduction:-
1.1 Purpose:-
The purposeof this application are as follows :
The software is the automation of the library.
It provides facilities to the
ADMIN:
Can enter details related to the particular book.
Can provide membership to the members.
Can read any information about any member.
Can create, update and delete records of any member as per the requirements
and as per the implementation plans.
USER:
Can find books without any membership.
Can view and download the books after membership.
2 SCOPE :-
The different areas where we can use this applications are:-
Any Educational institute can make use of it by providing information
about author , content of the available books.
It can be used in offices and can modifications can easily be done as per the
requirements.
40. 3. TECHNOLOGYUSED:-
Front end:-Servlets ,HTML,JAVA server pages
Back end:-MYSQL, Apache tomcat server
4.ASSUMPTIONS:-
This application is used to convert the manual application into online
application.
Customized data is used in this application.
User does not have right to enter any information about books.
5.OVERVIEW:-
Project is related to the library management which provides reading
services to its members. Any personcan become the member of the library by
filling the prescribed form.
They can view books and download them after becoming member of
the library .
6) FUNCTIONALITY:-
Keeps the record of members.
41. FEASIBILITY STUDY
In feasibility study we had undergone through various steps which are
describe as under :
1. Identify the origin of the information at different level.
2. Identify the expectation of user from computerized system.
3. Analyze the drawback of existing system(manual) system.
WORKING OF PRESENT MANUAL SYSTEM
The staffs of library are involved in the following tasks.
1. Membershipprocess :
Personhastofill membership formand they areprovidedwith member id.
PROPOSED SYSTEM
Proposed systemprovide with following solutions:-
1. It provides better and efficient service to the members.
2. Reduce the workload of the employee.
3. Faster retrieval of the information about the desired book.
4. All details are available on a single click.
42.
43. Future Scope
FUTURE SCOPE OF APPLICATION :
This application can be easily implemented under various situations. We can add
new features as and when we require. Reusability is possible as and when require
in this application. There is flexibility in all the modules
44. CONCLUSION
The pace of business is getting faster and faster, with a greater need to compete
and sustain a market. In this age of e−commerce, e−business, e−tailing, and other
e's, "traditional" system development just doesn't cut it anymore. Java Platform,
Enterprise Edition or Java EE is a widely used platform for server programming in
the Java programming language. TheJava platform (Enterprise Edition) differs
from the Java Standard Edition Platform (Java SE) in that it adds libraries which
provide functionality to deploy fault-tolerant, distributed, multi-tier Java software,
based largely on modular components running on an application server.
The Java platform comes in three flavors: Standard Edition, Enterprise Edition and
Macro Edition. The Enterprise Edition (J2EE) builds the Standard Edition &
includes number of technologies, such as Enterprise JavaBeans(EJB), Servlet and
JavaServer Pages, used for building enterprise server side- applications.