1) What is J2EE?

J2EE means Java 2 Enterprise Edition. The functionality of J2EE is developing multitier web-based applications .The J2EE platform is consists of a set of services, application programming interfaces (APIs), and protocols.

2)What are the components of J2EE application?
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components.

3)What is the J2EE module?
A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

4) What do Enterprise JavaBeans components contain?

  • Enterprise JavaBeans components contains Business code, which is logic that solves or meets the needs of a particular business domain such as banking, retail, or finance, is handled by enterprise beans running in the business tier. All the business code is contained inside an Enterprise Bean which receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program.

5) Define hash table:

HashTable is much the same as Hash Map,Collection having key(Unique),value sets. Hashtable is a gathering Synchronized object. It doesn’t permit duplicate values yet it permits null values

6) Why do you need a J2EE server? What services does a J2EE server provide?

A J2EE server provides system level support services such us security, transaction management, JNDI (Java Naming and Directory Interface) lookups, remote access etc. J2EE architecture provides configurable and nonconfigurable services. The configurable service enables the J2EE components within the same J2EE application to behave differently based on where they are deployed. For example the security settings can be different for the same J2EE application in two different production environments. The non-configurable services include enterprise bean (EJB) and servlet life cycle management, resource pooling etc. Server supports various protocols. Protocols are used for access to Internet services. J2EE platform supports HTTP (HyperText Transfer Protocol), TCP/IP (Transmission Control Protocol / Internet Protocol), RMI (Remote Method Invocation), SOAP (Simple Object Access Protocol) and SSL (Secured Socket Layer) protocol.

7) What is “applet”?

A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model.

8) What are types of J2EE clients?


  • Applets
  • Application clients
  • Java Web Start-enabled clients, by Java Web Start technology.
  • Wireless clients, based on MIDP technology.

9) What does application client module contain?
The application client module contains:
–class files,
–an application client deployment descriptoor.

Application client modules are packaged as JAR files with a .jar extension

10) What are considered as a web component?

Java Servlet and Java Server Pages technology components are web components. Servlets are Java programming language that dynamically receive requests and make responses. JSP pages execute as servlets but allow a more natural approach to creating static content.

11) What is JSF?

JavaServer Faces (JSF) is a user interface (UI) designing framework for Java web applications. JSF provide a set of reusable UI components, standard for web applications.JSF is based on MVC design pattern. It automatically saves the form data to server and populates the form date when display at client side.

12) What is JSF?
JSF is a user interface, it is use for designing framework for Java web applications.

13). What is Hibernate?
Hibernate an open source Java persistence framework project. Perform powerful object relational mapping and query databases using HQL and SQL.

14) What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?

There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.
--Jar files (files with a .jar extension) are intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
--War files (files with a .war extension) are intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.
--Ear files (files with a .ear extension) are intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.
Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.

15) What is "application assembler" ?
A person who combines J2EE components and modules into deployable application units.

16) .What is "application client" ?
A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some J2EE platform APIs.

17) Is HTML page a web component?

No. Static HTML pages and applets are bundled with web components during application assembly, but are not considered web components by the J2EE specification. Even the server-side utility classes are not considered web components, either.

18)What do you understand by the term ORM?

ORM means Object-Relational mapping. The objects in a Java class which is mapped into the tables of a relational database utilizing the meta-data that depicts the mapping between the objects and the database. It works by changing the information starting with one representation then onto the next

19).Explain the difference between get and load method

get() method returns invalid if the object can’t be found. The load() method may give back an intermediary rather than a real diligent instance get() would never return a proxy

20) What is “archiving”?

The process of saving the state of an object and restoring it.

21) What is “asant”?

A Java-based build tool that can be extended using Java classes. The configuration files are XML-based, calling out a target tree where various tasks get executed..

22) What is authentication?

The process that verifies the identity of a user, device, or other entity in a computer system, usually as a prerequisite to allowing access to resources in a system. The Java servlet specification requires three types of authentication-basic, form-based, and mutual-and supports digest authentication

23)What is “asant” ?

A Java-based build tool that can be extended using Java classes. The configuration files are XML-based, calling out a target tree where various tasks get executed.

24). What is “attribute”What is “asant” ?
A qualifier on an XML tag that provides additional information.


25). What is authentication ?

The process that verifies the identity of a user, device, or other entity in a computer system, usually as a prerequisite to allowing access to resources in a system. The Java servlet specification requires three types of authentication-basic, form-based, and mutual-and supports digest authentication.

26) Define Hash table

HashTable is just like Hash Map,Collection having key(Unique),value pairs. Hashtable is a collection Synchronozed object .It does not allow duplicate values but it allows null values.

27) What is Hibernate?

Hibernate is a open source object-relational mapping and query service. In hibernate we can write HQL instead of SQL which save developers to spend more time on writing the native SQL. Hibernate has more powerful association, inheritance, polymorphism, composition, and collections. It is a beautiful approach for persisting into database using the java objects. Hibernate also allows you to express queries using java-based criteria .

28) What are the the types of J2EE modules?
Application client module
Web module
Enterprise JavaBeans module
Resource adapter module

29) What does web module contain?
The web module contains:
JSP files,
class files for servlets,
GIF and HTML files, and
a Web deployment descriptor.
Web modules are packaged as JAR files with a .war (Web ARchive) extension.

30). JSF Stand for?
JavaServer Faces (JSF)

31) What is "application client module" ?
A software unit that consists of one or more classes and an application client deployment descriptor.

32),What is "application component provider" ?
A vendor that provides the Java classes that implement components' methods, JSP page definitions, and any required deployment descriptors.

33)What is "application configuration resource file" ?
An XML file used to configure resources for a Java Server Faces application, to define navigation rules for the application, and to register converters, Validator, listeners, renders, and components with the application.

34) What is "archiving" ?
The process of saving the state of an object and restoring it.

35)What is the container?

Containers are the interface between a component and the low-level platform specific functionality that supports the component. Before a Web, enterprise bean, or application client component can be executed, it must be assembled into a J2EE application and deployed into its container.

36) What are container services?

A container is a runtime support of a system-level entity. Containers provide components with services such as lifecycle management, security, deployment, and threading.

37) What is connection pooling?

Connection pooling is a system reuse the connection.which contains the quantity of as of now made object connections. So at whatever point there is a fundamental for object, this system is utilized to specifically get objects without making it

38).What do you mean by HQL?

HQL represents Hibernate Query Language. Hibernate permits to the client to express questions in its own particular convenient SQL extension and this is called as HQL. It additionally permits the user to express in native SQ

39) What is “application client module”?

A software unit that consists of one or more classes and an application client deployment descriptor.

40) What is “application component provider”?

A vendor that provides the Java classes that implement components’ methods, JSP page definitions, and any required deployment descriptors.

41) What is “application configuration resource file”?

An XML file used to configure resources for a Java Server Faces application, to define navigation rules for the application, and to register converters, Validator, listeners, renders, and components with the application.

  • JPA provider in JPA based applications.

42) What is ORM?

ORM stands for Object-Relational mapping. The objects in a Java class which is mapped in to the tables of a relational database using the metadata that describes the mapping between the objects and the database. It works by transforming the data from one representation to another.

43) Difference between save and saveorupdate?

save() – This method in hibernate is used to stores an object into the database. It insert an entry if the record doesn’t exist, otherwise not.

saveorupdate () -This method in the hibernate is used for updating the object using identifier. If the identifier is missing this method calls save(). If the identifier exists, it will call update method.

44) Difference between load and get method?

load() can’t find the object from cache or database, an exception is thrown and the load() method never returns null.

get() method returns null if the object can’t be found. The load() method may return a proxy instead of a real persistent instance get() never returns a proxy.

45)What is “applet container” ?

A container that includes support for the applet programming model.

46). What is “application assembler” ?
A person who combines J2EE components and modules into deployable application units.

47) What is “application client” ?
A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some J2EE platform APIs.

48) What are the benefits of ORM?

  • Productivity
  • Maintainability
  • Performance
  • Vendor independence

49) What the Core interfaces are of hibernate framework?

  • Session Interface
  • SessionFactory Interface
  • Configuration Interface
  • Transaction Interface
  • Query and Criteria Interface

50) What is the file extension used for hibernate mapping file?

The name of the file should be like this : filename.hbm.xml

51) What is the file name of hibernate configuration file?

The name of the file should be like this : hibernate.cfg.xml

52) What is Struts?

Struts framework is a Model-View-Controller(MVC) architecture for designing large scale applications. Which is combines of Java Servlets, JSP, Custom tags, and message. Struts helps you to create an extensible development environment for your application, based on published standards and proven design patterns. Model in many applications represent the internal state of the system as a set of one or more JavaBeans.The View is most often constructed using JavaServer Pages (JSP) technology.The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class Action Servlet. This servlet is configured by defining a set of Action Mappings.

53).What is ActionErrors?

ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.The default implementation attempts to forward to the HTTP version of this method. Holding request parameters mapping and request and returns set of validation errors, if validation failed; an empty set or null.

54)What is ORM?
Object-relational mapping (ORM, O/RM, and O/R mapping) in computer science is a programming technique for converting data between incompatible type systems in object-oriented programming languages.

This creates, in effect, a "virtual object database" that can be used from within the programming language.

55). Benefits of Object-Relational Mapping (ORM)
Productivity
Application design
Code Reuse
Application Maintainability

56). HQL stands for?
Hibernate Query Language

57) What are the four types of J2EE modules?
1. Application client module
2. Web module
3. Enterprise JavaBeans module
4. Resource adapter module

55).What does application client module contain?
The application client module contains:
--class files,
--an application client deployment descriptor.
Application client modules are packaged as JAR files with a .jar extension.

56) .What does web module contain?
The web module contains:
--JSP files,
--class files for servlets,
--GIF and HTML files, and
--a Web deployment descriptor.
Web modules are packaged as JAR files with a .war (Web ARchive) extension.

57) What is J2EE?

  • Ans. J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitiered, web-based applications.
58) . What are the components of J2EE application?

A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:

  • Application clients and applets are client components.
  • Java Servlet and JavaServer Pages technology components are web components.
  • Enterprise JavaBeans components (enterprise beans) are business components.
  • Resource adapter components provided by EIS and tool vendors.

59) Explain MVC architecture relating to J2EE ?

This is also a very popular interview question. MVC stands for Model-View-Controller architecture. It divides the functionality of displaying and maintaining of the data to minimize the degree of coupling (i.e. promotes loose coupling) between components. It is often used by applications that need the ability to maintain multiple views like HTML, WML, Swing, XML based Web service etc of the same data. Multiple views and controllers can interface with the same model. Even new types of views and controllers can interface with a model without forcing a change in the model design.

  • A MODEL represents the core business logic and state. A model commonly maps to data in the database and will also contain core business logic.
  • A VIEW renders the contents of a model. A view accesses the data from the model and adds display logic to present the data.
  • A CONTROLLER acts as the glue between a model and a view. A controller translates interactions with the view into actions to be performed by the model. User interactions in a Web application appear as GET and POST HTTP requests. The actions performed by a model include activating business processes or changing the state of the model. Based on the user interactions and the outcome of the model actions, the controller responds by selecting an appropriate view.

60) What is the difference between a Web server and an application server ?

Web Server

  • Supports HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page (static content) or delegates the dynamic response generation to some other program such as CGI scripts or Servlets or JSPs in the application server.
  • Uses various scalability and fault-tolerance techniques

Application Server

  • Exposes business logic and dynamic content to the client through various protocols such as HTTP, TCP/IP, IIOP, JRMP etc. Uses various scalability and fault-tolerance techniques. In addition provides resource pooling, component life cycle management, transaction management, messaging, security etc.
  • Provides services for components like Web container for servlet components and EJB container for EJB components.

61) What is “application assembler”?

A person who combines J2EE components and modules into deployable application units.

62) What is “application client”?

A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some J2EE platform APIs.

63)What is Hibernate?

Hibernate is a open source object-relational mapping and query service. In hibernate we can write HQL instead of SQL which save developers to spend more time on writing the native SQL. Hibernate has more powerful association, inheritance, po0lymorphism, composition, and collections. It is a beautiful approach for persisting into database using the java objects. Hibernate also allows you to express queries using java-based criteria .

64) What is the limitation of hibernate?

  • lower in executing the queries than queries are used directly.
  • Only query language support for composite keys.
  • No shared references to value types.

65) J2EE Stand for?
Java 2 Platform Enterprise Edition.

66) What are the advantage of hibernate.?

  • Hibernate is portable i mean database independent, Vendor independence.
  • Standard ORM also supports JPA
  • Mapping of Domain object to relational database.
  • Hibernate is better then plain JDBC.

67). What is cascade delete ?
A deletion that triggers another deletion. A cascade delete can be specified for an entity bean that has container-managed persistence.

68). What is CDATA ?
A predefined XML tag for character data that means “don’t interpret these characters,” as opposed to parsed character data (PCDATA), in which the normal rules of XML syntax apply. CDATA sections are typically used to show examples of XML syntax.

69). What is certificate authority ?
A trusted organization that issues public key certificates and provides identification to the bearer.


70) What is Spring?

Spring is a light weight open source framework for the development of enterprise application that resolves the complexity of enterprise application development also providing a cohesive framework for J2EE application development. Which is primarily based on IOC (inversion of control) or DI (dependency injection) design pattern.

71) Functionality of ActionServlet and RequestProcessor?

  • Receiving the HttpServletRequest
  • Populating JavaBean from the request parameters
  • Displaying response on the web page Issues
  • Content type issues handling
  • Provide extension points

72)what are the components of Controller

ActionServlet, RequestProcessor and Action classes

73) What is Spring?

Spring is a light weight open source framework for the development of enterprise application that resolves the complexity of enterprise application development also providing a cohesive framework for J2EE application development. Which is primarily based on IOC (inversion of control) or DI (dependency injection) design pattern.

74)Functionality of ActionServlet and RequestProcessor?

  • Receiving the HttpServletRequest
  • Populating JavaBean from the request parameters
  • Displaying response on the web page Issues
  • Content type issues handling
  • Provide extension points

75)what are the components of Controller

ActionServlet, RequestProcessor and Action classesZ

76)What are the JSP tags?

In JSP tags can be divided into 4 different types.

  • Directives
  • Declarations
  • Scriplets
  • Expressions

77)what is struts?

Struts framework is a Model-View-Controller(MVC) architecture for designing large scale applications. Which is combines of Java Servlets, JSP, Custom tags, and message. Struts helps you to create an extensible development environment for your application, based on published standards and proven design patterns. Model in many applications represent the internal state of the system as a set of one or more JavaBeans.The View is most often constructed using JavaServer Pages (JSP) technology.The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class ActionServlet. This servlet is configured by defining a set ofActionMappings.

78)What is ActionErrors?

Ans:ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.The default implementation attempts to forward to the HTTP version of this method. Holding request parameters mapping and request and returns set of validation errors, if validation failed; an empty set or null

79) What are ear, war and jar files? What are J2EE Deployment Descriptors ?

The ear, war and jar are standard application deployment archive files. Since they are a standard, any application server (at least in theory) will know how to unpack and deploy them. An EAR file is a standard JAR file with an ".ear" extension, named from Enterprise ARchive file. A J2EE application with all of its modules is delivered in EAR file. JAR files can�t have other JAR files. But EAR and WAR (Web ARchive) files can have JAR files. An EAR file contains all the JARs and WARs belonging to an application. JAR files contain the EJB classes and WAR files contain the Web components (JSPs, Servlets and static content like HTML, CSS, GIF etc). The J2EE application client's class files are also stored in a JAR file. EARs, JARs, and WARs all contain one or more XMLbased deployment descriptor(s).

80)Deployment Descriptors

A deployment descriptor is an XML based text file with an ".xml" extension that describes a component's deployment settings. A J2EE application and each of its modules has its own deployment descriptor.

  • application.xml: is a standard J2EE deployment descriptor, which includes the following structural information: EJB jar modules, Web war modules, etc. Also since EJB jar modules are packaged as jars the same way dependency libraries like log4j.jar, MyAppsUtil.jar etc are packaged. The application.xml descriptor will distinguish between these two types of jar files by explicitly specifying the EJB jar modules.
  • ejb-jar.xml: is a standard deployment descriptor for an EJB module.
  • web.xml: is a standard deployment descriptor for a Web module.

81)Explain J2EE class loaders ?

J2EE application server sample class loader hierarchy is shown below. As per the diagram the J2EE application specific class loaders are children of the "System -classpath" class loader. When the parent class loader is above the "System -classpath" class loader in the hierarchy as shown in the diagram (i.e. bootstrap class loader or extensions class loader) then child class loaders implicitly have visibility to the classes loaded by its parents. When a parent class loader is below a "System -classpath" class loader in the hierarchy then the child class loaders will only have visibility into the classes loaded by its parents only if they are explicitly specified in a manifest file (MANIFEST.MF) of the child class loader.

82) What is the syntax to invoke a stored procedure in hibernate?

{ ? = call thisISTheProcedure()

83) .List out the advantages of ORM:

- Ability to maintain.

- Performance.

- Vendor independence.

- Productivity

83)Are JavaBeans J2EE components?

No. JavaBeans components are not considered J2EE components by the J2EE specification. They are written to manage the data flow between an application client or applet and components running on the J2EE server or between server components and a database. JavaBeans components written for the J2EE platform have instance variables and get and set methods for accessing the data in the instance variables. JavaBeans components used in this way are typically simple in design and implementation, but should conform to the naming and design conventions outlined in the JavaBeans component architecture

84) What makes J2EE suitable for distributed multitiered Applications?

The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multitiered J2EE environment to which the application component belongs. The J2EE application parts are:



  • Client-tier components run on the client machine.



  • Web-tier components run on the J2EE server.



  • Business-tier components run on the J2EE server.



  • Enterprise information system (EIS)-tier software runs on the EIS server.


85) What is data ?

The contents of an element in an XML stream, generally used when the element does not contain any subelements. When it does, the term content is generally used. When the only text in an XML structure is contained in simple elements and when elements that have subelements have little or no data mixed in, then that structure is often thought of as XML data, as opposed to an XML document.

86)What is DDP ?
Document-driven programming. The use of XML to define applications.

87)What is declaration ?
The very first thing in an XML document, which declares it as XML. The minimal declaration is . The declaration is part of the document prolog.

88)What is declarative security ?
Mechanisms used in an application that are expressed in a declarative syntax in a deployment descriptor.

89)What is delegation ?
An act whereby one principal authorizes another principal to use its identity or privileges with some restrictions.

90)What is deployer ?
A person who installs J2EE modules and applications into an operational environment.

91)What is deployment ?
The process whereby software is installed into an operational environment.

92)What is J2EE?
J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications.

93) What do you understand by J2EE?

J2EE implies Java 2 Enterprise Edition. The usefulness of J2EE is creating multi-tier web applications .The J2EE platform comprises of an arrangement of services, application programming interfaces (APIs), and conventions

94).What are the web components?

Java Server Pages and Java Servlet technology components are web components. Servlets is Java language that powerfully get requests and frames responses. JSP pages execute as servlets yet permit a more regular way to deal with making static content

95)What is J2EE? What are J2EE components and services?

J2EE (Java 2 Enterprise Edition) is an environment for developing and deploying enterprise applications. The J2EE platform consists of J2EE components, services, Application Programming Interfaces (APIs) and protocols that provide the functionality for developing multi-tiered and distributed Web based applications.
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:

Component type

Components

Packaged as

Applet

applets

JAR (Java ARchive)

Application client

Client side Java codes.

JAR (Java ARchive)

Web component

JSP, Servlet

WAR (Web ARchive)

Enterprise JavaBeans

Session beans, Entity beans, Message driven beans

JAR (EJB Archive)

Enterprise application

WAR, JAR, etc

EAR (Enterprise ARchive)

Resource adapters

Resource adapters

RAR (Resource Adapter ARchive)

96)So what is the difference between a component and a service?

A component is an application level software unit as shown in the table above. All the J2EE components depend on the container for the system level support like transactions, security, pooling, life cycle management, threading etc. A service is a component that can be used remotely through a remote interface either synchronously or asynchronously (e.g. Web service, messaging system, sockets, RPC etc). A service is a step up from "distributed objects". A service is a function that has a clearly defined service contract (e.g. interface, XML contract) to their consumers or clients, self contained and does not depend on the context or state of other services.

97)What is a Service Oriented Architecture (SOA)?

SOA is an evolution of the fundamentals governing a component based development. Component based development provides an opportunity for greater code reuse than what is possible with Object Oriented (OO) development. SOA provides even greater code reuse by utilizing OO development, component based development and also by identifying and organizing right services into a hierarchy of composite services. SOA results in loosely coupled application components, in which code is not necessarily tied to a particular database. SOAs are very popular and there is a huge demand exists for development and implementation of SOAs.

98)What are Web and EJB containers?

Containers (Web & EJB containers) are the interface between a J2EE component and the low level platform specific functionality that supports J2EE components. Before a Web, enterprise bean (EJB), or application client component can be executed, it must be assembled into a J2EE module (jar, war, and/or ear) and deployed into its container.

99) What is J2EE?

J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications.


100) What is the J2EE module?

A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

100) What is the J2EE module?