ADVANCED JAVA PROGRAMMING QUESTION BANK FOR II MSC IT MADRAS UNIVERSITY

 

UNIT-1

1 MARK

1.What is meant by session tracking? 

Session Tracking is a way to maintain state (data) of a user.

It is also known as session management in servlets.

2.What is the use of Java web servers? 

It is a computer where the web content can be stored.

In general web servers can be used to host the web sites but there also

used some other web servers also such as FTP, email, storage, gaming etc.

Examples of Web Servers are: Apache Tomcat and Resin.

3.What are the uses of Servlet? 

Servlets execute within the address space of a Web server.

It is not necessary to create a separate process to handle each client request.

Servlets are platform-independent because they are written in Java.

4.How will you communicate between two applets? 

java.applet.AppletContext class provides the facility of communication between applets.

We provide the name of the applet through the HTML file.

It provides the getApplet() method that returns the object of Applet.

Syntax:

public Applet getApplet(String name){}

5.What is JDBC? How do you connect to the

database?

JDBC is an acronym for Java Database Connectivity.

It’s an advancement for ODBC ( Open Database Connectivity ).

JDBC is a standard API specification developed in order to move data

from frontend to backend. This API consists of classes and interfaces written in Java.

It basically acts as an interface (not the one we use in Java) or channel

between your Java program and databases i.e it establishes a

link between the two so that a programmer could send data from Java code

and store it in the database for future use.


6.What's the difference between servlet and applets? 

applets

Applets are executed on client-side i.e applet runs within a Web browser on

the client machine.

Important methods of applet include init(), stop(), paint(), start(), destroy().

servlets

Servlets on other hand executed on the server-side i.e servlet runs on the web

Page on server.

Lifecycle methods of servlet are init( ), service( ), and destroy( ).

7.Is there any tag in HTML to upload and download

files? 

<a> is the link tag.

8.What are the four drivers available in JDBC? 

There are 4 types of JDBC drivers:

Type-1 driver or JDBC-ODBC bridge driver.

Type-2 driver or Native-API driver.

Type-3 driver or Network Protocol driver.

Type-4 driver or Thin driver.

9.Define applet. 

An applet is a Java program that runs in a Web browser.

10.What is Java media framework? 

The Java Media Framework API (JMF) enables audio, video and other

time-based media to be added to applications and applets built on Java technology.

11.What are the important attributes of FORM tag? 

action:Specifies a URI/URL of the back-end script that will process the form

method:Specifies the HTTP method to use when the form is submitted.

name:Defines a unique name for the form.

input: It is used to specify the input field for the user.

textarea: It is used to specify a multi-line text input field for users.

button: It is used to perform an operation in a form by the user.

label: It is used to give a label to any tag like button, input etc.

12.State the need of a web.xml file in an application server? 

Java web applications use a deployment descriptor file to determine how

URLs map to servlets, which URLs require authentication, and other information.

This file is named web.xml, and resides in the app's WAR under the

WEB-INF/ directory. web.xml is part of the servlet standard for web applications.

13.What is Servlet interface? 

This interface is for developing servlets. A servlet is a body of

Java code that is loaded into and runs inside a servlet engine, such as a web server.

The Servlet interface defines methods to initialize a servlet, to receive and

respond to client requests, and to destroy a servlet and its resources.

14.How do you set security in applets? 

To set up secure access for applets that will access the file system or Notes

Java classes through Notes, you must first set up an access control list (ACL),

then set up an execution control list (ECL) for each user or group. 

15.What are the strengths in servlet?

Better performance: because it creates a thread for each request, not process.

Portability: because it uses Java language.

Robust: JVM manages Servlets, so we don't need to worry about the memory leak,

garbage collection, etc.

Secure: because it uses java language.

16.What is meant by a single threaded servlet? 

Ensures that servlets handle only one request at a time. This interface has no methods.

If a servlet implements this interface, you are guaranteed that no two threads

will execute concurrently in the servlet's service method.

17.Give life cycle of servlet.

A servlet life cycle can be defined as the entire process from its creation till

the destruction. The following are the paths followed by a servlet.

The servlet is initialized by calling the init() method.

The servlet calls service() method to process a client's request.

The servlet is terminated by calling the destroy() method.

Finally, the servlet is garbage collected by the garbage collector of the JVM.

18.Why does the JDBC be needed? 

 The JDBC API was modeled after ODBC, but, because JDBC is a Java API,

it offers a natural Java interface for working with SQL. JDBC is needed to

provide a "pure Java" solution for application development.

19.Define Servlet.

A servlet is a Java programming language class that is used to extend

the capabilities of servers that host applications accessed by means of a

request-response programming model.

20.What is session tracking?

Session tracking is a mechanism that servlets use to maintain state about a

series of requests from the same user (that is, requests originating from the

same browser) across some period of time. Sessions are shared among the

servlets accessed by a client.

21.Give the components of JDBC. 

JDBC DriverManager

JDBC API

JDBC-ODBC Bridge driver

5 MARK

1.What is servlet chaining? Explain. 

2.Describe the basic concepts of servlet life cycle.

3.Write short notes on JDBC drivers. 

4.What is server side include? Explain

5.Describe the life cycle methods of servlet with a neat diagram. 

6.What are the advantages and disadvantages of the Get method? 

7.Describe briefly on the servlet interface. 

8.What are the advantages of using servlet than using CGI? Explain. 

9.Explain applet and servlet communication with example. 

10.How to create servlet filter elements? 

11.Explain the usage of JDBC in servlet with an example

12.What are the uses of servlet? Explain. 

13.What are the types of statements in JDBC? Explain with examples.

10 MARK

1.Explain session management in servlet.

2.Explain connection establishment of JDBC. 

3.Explain applet and servlet communication with example. 

4.Explain in detail about servlet architecture with necessary diagrams. 

5.Explain the life cycle of servlets. 

6.Write an Airline Reservation Program using JDBC and servlet.

7.Explain briefly about applet to servlet communication with an example.

 8.Explain briefly the session tracking API with HTTP session objects. 

9.Explain briefly session tracking with servlet. 

10.Explain HTTP GET and HTTP POST requests.

11.Write a servlet code to display Name, ISBN number, prize data of book stored in database, (use form). 

12.How session tracking can be achieved in servlets?

UNIT-2

1 MARK

1.Specify any two bound properties.

  • color,font style and font size of the title

  • position of the title

2.What is persistence?

The Java Persistence API (JPA) is a specification of Java.

 It is used to persist data between Java objects and relational databases. 

JPA acts as a bridge between object-oriented domain models and relational 

database systems.

3.Distinguish between Java bean and EJB.

java bean

Javabeans is a component technology to create universal Java components.

ejb

Even though EJB is a component technology, it neither reconstructs nor

 enhances the original JavaBean specification.

4.What is a Bean box?

BeanBox is a test container in BDK. 

We can use BeanBox to create Application, Applet, and New Beans. 


5. When is the bean customizer needed? 

Customizers give you complete GUI control over bean customization. 

Customizers are used where property editors are not practical or applicable.

Unlike a property editor, which is associated with a property, 

a customizer is associated with a bean.

6.How to extract files from a JAR file? 

The basic command to use for extracting the contents of a JAR file is:


jar xf jar-file [archived-file(s)]

7.What do you mean by introspection?

Introspection is the automatic process of analyzing a bean's design 

patterns to reveal the bean's properties, events, and methods

8.What is a JAR file?

JAR stands for Java ARchive. It's a file format based on the popular 

ZIP file format and is used for aggregating many files into one.

9.Define BDK.

The Bean Developer Kit (BDK), available from the Java Soft site, 

is a simple example of a tool that enables you to create, configure,

and connect a set of Beans. There is also a set of sample Beans with their source code.

10. What is DNS?  

DNS: Domain Name System

 A DNS is an internet service that translates a domain name into a corresponding IP address.

 Domain name used here is alphabetic and can be easily remembered. 

For example, www.example.com is a domain name of a site.

11.What are the services in Java beans?

The JavaBean properties and methods can be exposed to another application.

It provides an ease to reuse the software components.

12.Define Entity Bean Interface.

The entity bean remote interface is the interface that the customer sees and invokes methods upon. 

It extends javax.ejb.EJBObject and defines the business logic methods. 

13.Give the meaning of notable beans. 

Hot Java Html component,which consists of several beans that can be used to add web-browsing support to window  applications

14.Write the features of Java beans.

JavaBeans provide default constructor without any conditions or arguments

JavaBeans are serializable and are capable of implementing the Serializable interface

JavaBeans usually have several ‘getter’ and ‘setter’ methods

JavaBeans can have several properties that can be read or written

15.What is serialization?

The mechanism that makes persistence possible is called serialization.

 Object serialization means converting an object into a data stream and 

writing it to storage. Any applet, application, or tool

 that uses that bean can then "reconstitute" it by deserialization.

 The object is then restored to its original state.

16.State the advantages of java bean.

A Bean obtains all the benefits of Java's "write-once, run-anywhere" paradigm. 

The properties, events, and methods of a Bean that are exposed to an application

the builder tool can be controlled.

A Bean may be designed to operate correctly in different locales, which makes it

useful in global markets.

Auxiliary software can be provided to help a person configure a Bean. 

This software is only needed when the design-time parameters for that

 components are being set. It does not need to be included in the run-time environment.

The configuration settings of a Bean can be saved in persistent

 storage and restored at a later time.

17.What is a stateless session bean? 

A stateless session bean does not maintain a conversational state with the client.

 when a client invokes the methods of a stateless bean, the bean’s instance

variables may contain a state specific to that client but only for the duration of the invocation.

5 MARK

1.Is java beans a complete component architecture? Explain. 

2.Explain briefly the development of Glasgow.

 3.What is meant by bean astonization? Explain

4.Explain the working of info bus

5.What is introspection? Explain. 

6.Discuss about design patterns for bean properties. 

7.Explain Container -Managed Persistence with an example. 

8.List out the steps that involved creating a new bean

9.Explain three parts of bound properties. 

10.Explain the structure of infobus. 

10 MARK

1.Describe the API'S of Java bean in detail. 

2.Explain life cycle of a session bean in detail. 

3.Discuss in detail about notable beans. 

4.What is Java bean API? Explain any four components. 


UNIT-3

1 MARK

1.What are the three types of EJB? 

✦ Entity beans

✦ Session beans

✦ Message-driven beans

2.Define WAR file. 

A war (web archive) File contains files of a web project. It may have servlet, xml,

jsp, image, html, css, js etc. files.It reduces the time duration for transferring files.

3.Define java beans. 

A JavaBean is a Java class that should follow the following conventions:

It should have a no-arg constructor.

It should be Serializable.

It should provide methods to set and get the values of the properties,

known as getter and setter methods.

4.What are some common pitfalls and practices to avoid when using an enterprise bean? 

  • JavaBeans are mutable. So, it can't take advantage of immutable objects.

  • Creating the setter and getter method for each property separately may

  • lead to the boilerplate code.

5.How should system exceptions be handled from an enterprise bean? 

A system exception indicates a problem with the services that support an application. 

If it encounters a system-level problem,  enterprise bean should throw

a javax.ejb.EJBException. Because the EJBException is a subclass of

the RuntimeException, you do not have to specify it in the throws clause of the

method declaration. 

If a system exception is thrown, the EJB container might destroy the bean instance.

Therefore, a system exception cannot be handled by the bean’s client program,

but instead requires intervention by a system administrator.

An application exception signals an error in the business logic of an enterprise bean. 

6.What is the difference between Java bean and EJB?

Javabeans is a component technology to create universal Java components.

Even though EJB is a component technology, it neither reconstructs nor

enhances the original JavaBean specification.

7. How can nested transactions be implemented with enterprise bean?

Java EE does not support nested transactions. The only thing it supports is

suspending a transaction, running an unrelated transaction, and the resuming

the first transaction.

To accomplish that, you would need to call another EJB that uses the

RequiresNew transaction attribute. Note that the inner transaction can

complete even if the message receipt rolls back, which means if the messaging

engine crashes, the second transaction might be run again.

Alternatively, you could change the EJB to use bean-managed transactions,

which would have a similar effect.


 8. What are the issues involved in creating a singleton with enterprise beans? 

The singleton session bean is initialized before the EJB container delivers client

requests to any enterprise beans in the application. This allows the singleton session

bean to perform, for example, application startup tasks.

9.What is EJB role in J2EE? 

EJB stands for Enterprise Java Beans. EJB is an essential part of a J2EE platform.

J2EE platform has component based architecture to provide multi-tiered,

distributed and highly transactional features to enterprise level applications.

10. What elements of the Perl Language could you use to structure your code

to allow for maximum reuse and maximum readability?

  • modularize code and include them where required using the “use” command

  • use subroutines or functions to segregate operations thereby making the code

  • more readable

  • use objects to create programs wherever possible which greatly promotes code reuse

  • include appropriate comments as and when required

  • eliminate any dereferencing operator

11. Distinguish between Java bean and EJB. 

  • JavaBeans are designed for a single process and are localized

  • EJBs are remotely executable components or business objects.

12. Write the benefits of EJB. 

  • Simplified development of large-scale enterprise level application.

  • Application Server/EJB container provides most of the system level

  • services like transaction handling, logging, load balancing, persistence mechanism,

  • exception handling, and so on. Developer has to focus only on the business logic

  • of the application.

  • EJB containers manage the life cycle of EJB instances, thus developers need not

  • to worry about when to create/delete EJB objects.

13. When is the bean customizer needed? 

Customizers are used where sophisticated instructions would be needed to change a bean,

and where property editors are too primitive to achieve bean customization.

14.Differentiate stateful and stateless session bean. 

Stateless Session Bean 

  • Stateless Session bean is a business object that represents business logic only.

  • It doesn't have state (data).

  • The stateless bean objects are pooled by the EJB container to service the

  • request on demand.

  • There are 3 important annotations used in stateless session bean:

  1. @Stateless

  2. @PostConstruct

  3. @PreDestroy

Stateful Session Bean

  • Stateful Session bean is a business object that represents business logic

  • like a stateless session bean. But, it maintains state (data).

  • conversational state between multiple method calls is maintained by the

  • container in the stateful session bean.

  • There are 5 important annotations used in stateful session bean:

  • @Stateful

  • @PostConstruct

  • @PreDestroy

  • @PrePassivate

  • @PostActivate

15. What is an entity bean? 

Entity beans represent and manipulate the persistent data of an application,

providing an object-oriented view of data that are frequently stored in relational

databases. This is an important advantage to users, because the underlying format

in which data may well be stored in a database is via relational tables accessed through SQL queries and stores.

16.How many EJB objects are created for a Bean? 

Only one Object Created for a bean.

17.What is an EJB Client? 

When one enterprise bean (call it the source enterprise bean) accesses

another enterprise bean (call it the target enterprise bean), the source enterprise

bean is the client of the target enterprise bean.

18. Compare EJB session bean and EJB entity bean.

Session Beans 

  • Session Beans represent a process or flow.

  • Each session bean is associated with one EJB client at time.

  • Session beans don’t survive in middleware system shutdown.

  • That means they’re not persistent

Entity bean

  • Entity beans represent rows in a database.

  • Each entity bean is associated with more than one client at time.

  • Entity bean have two types: CMP (Container managed persistence) and BMP (Bean managed persistence)

  • Entity beans do survive in system shutdown. Entity beans are persistent.

19.Write the meaning of scalar variable in perl. 

A scalar is a single unit of data. That data might be an integer number,

floating point, a character, a string, a paragraph, or an entire web page.

20.What is a stateless session bean? 

Stateless session beans do not maintain any state and are not specific to a

particular client. Session beans can handle two types of transaction:

Container-managed transactions (CMT)

Bean-managed transactions (BMT)

5 MARK

1.What are the relationships and responsibilities of EJB? Explain. 

2. Differentiate stateless and stateful session bean.

3.What is enterprise java bean query language? Give some examples. 

4.Explain array function and hash function with example. 

5.What are the control structures available in Perl?

6.Explain with examples.

7.What is meant by bean astonization? Explain. 

8.What is introspection? Explain.

9.Distinguish between stateful and stateless session beans. 

10. Explain enterprise bean lifecycle methods in detail.

11.Explain Container -Managed Persistence with an example. 

12.Write short notes on EJB session bean and entity bean.

13.Explain the functions and scope of Perl. 

14.How does EJB support asynchronous communication with clients? 

15.Discuss about file operation in Perl.

16.Explain EJB requirements. 

17.Write the features of the application server in EJP.

18.Explain how the EJB interacts with other beans. 

10 MARK

1.Explain the architecture of EJB with a neat diagram.

2.Describe the control structures and operators of Perl with suitable examples. 

3.Describe the roles, relationship and responsibilities of EJB with a neat diagram.

4. Explain the functions and scope of Perl with suitable examples.

5.What are the two subtypes of entity bean? Explain the two types in detail. 

6.Explain EJB architecture. 

7.Explain life cycle of a session bean in detail. 

8.Describe the implementation and future direction of EJB. 

9.Write a program to develop an Enterprise JavaBean for library operations. 

10.Describe the functions of different types of client views available in EJB. 

11.What is an EJB Client? Explain EJB deployment model.

12. Explain arithmetic and string functions used in PERL.

UNIT 4

1 MARK

1)What is RMI

The RMI (Remote Method Invocation) is an API that provides a mechanism to create distributed applications in java. The RMI allows an object to invoke methods on an object running in another JVM.

2)Give the Meaning of REMOTE ACTIVATION

Java RMI activation is a process that continually runs on a system to ensure that activatable services are available when they are needed. 

3)What is ORB, give example

 The ORB is both a tool and a runtime component EG: WebSphere Application Server provided by IBM

4)How will you declare RMI

  • A remote interface defines method(s) that can be invoked remotely by a client.

  •  Like any Java interfaces, the remote interfaces describe the behavior of remote objects and do not contain the implementation of this behavior. 

  • The client program will “have a feeling” that it calls local methods, but actually these calls will be redirected to a remote server. 

5)What are the procedures to register RMI

  1.  Create the remote interface

  2. Provide the implementation of the remote interface

  3. Compile the implementation class and create the stub and skeleton objects using the rmic tool

  4. Start the registry service by rmi registry tool

  5. Create and start the remote application

  6. Create and start the client application

6)State the role of stub in RMI

The stub is an object, and acts as a gateway for the client side. All the outgoing requests are routed through it. It resides at the client side and represents the remote object.

7)State the methods for registering remote interface

  • bind():  Binds the specified name to the remote object.

  • unbind(): removes an object from the registry.

  • rebind(): replaces any preexisting registry entry with the new one.

8)Specify the goal of RMI

  • To minimize the complexity of the application. 

  • To preserve type safety. 

  • Distributed garbage collection. 

  • Minimize the difference between working with local and remote objects.

9)What is java RMI?

 RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM. RMI is used to build distributed applications; it provides remote communication between Java programs. It is provided in the package java. rmi.

10)What is IIOP

IIOP (Internet Inter-ORB Protocol) is a protocol that makes it possible for distributed programs written in different programming languages to communicate over the Internet

11)Define STUB and skeleton

 The stub is an object, acts as a gateway for the client side. All the outgoing requests are routed through it. It resides at the client side and represents the remote object. 

 The skeleton is an object, and acts as a gateway for the server side object. All the incoming requests are routed through it

12)What are the components of RMI application

1.CLIENT

2. SERVER

3.REGISTRY

14)what is meant by remote exceptions 

  • In RMI applications, all remote methods must declare java.rmi.RemoteException.

  • This exception will be thrown by the server application in such cases as communication failures, marshalling or unmarshalling errors, and so on. 

  • Because a Remote Exception is a checked exception, it has to be handled in the client code.

15) EXPAND JNDI

JAVA NAMING and DIRECTORY INTERFACE

16) What do you mean by Rmic ?

RMI compiler ,tool which automatically programs the network communications in RMI applications

17)  write down the rules for creation of remote interfaces.

  • An application’s remote interface must declare business methods having  public access that will enable clients to communicate with the server.

  • An application’s remote interface must extend the java.rmi.Remote interface. The Remote interface does not have any methods — just declare the required methods there.

  • Each method must declare a java.rmi.RemoteException or one of its ancestors.

  • Method arguments and return data types must be serializable.

18) Expand CORBA

  • Common object Request Broker Architecture.

  • Enables communication between distributed components written in different languages.

19) Mention the business applications that uses RMI technology

  • Getting stock market price quotes

  • Obtaining flight information

  • Requesting and downloading music files

  • Performing inventory maintenance

5 MARK

1)Explain Stub and Skeleton in RMI

2)Remote Activation

3)What is RMI and steps involved in developing an RMI object

4)Discuss RMI over Inter-ORB Protocol in detail

5)What is a remote interface in RMI? Explain

6)Describe how RMI Mechanism works?

7)Explain the role of stub in RMI

8)What are the steps needed for developing an application with RMI

9)write about pushing data from the RMI servers in airline scenario 

10)How to implement remote interfaces? Explain 

11) .Write down the steps for writing distributed RMI applications

1. Declaring a remote interface for the client

2. Implementing a remote interface on the server

3. Writing a client program that uses this remote interface to connect to a server

and call its methods

4. Generating stubs (client proxies) and skeletons (server entities)

5. Starting the registry on the server and registering remote objects with it

6. Starting the server application on the remote machine

7. Starting the Java application that is either located on the client machine or downloaded as a Java applet

10 MARKS

1)Explain RMI Architecture along with interfaces

2)Explain in detail about RMI Servlet

3)Discuss about pushing data from the server in detail

4)Explain the method of defining remote interface and implementing user interface in RMI

5)How to push data from RMI servlet? Explain with example

6)How to declare and implement the remote interfaces? Explain with example

7)How to register remote objects? Explain

8)Discuss about writing RMI clients in detail

UNIT-5

1 MARK

1.Give some protocols used in Java mail

  •  SMTP

  • POP

  • IMAP

  • MIME

  • NNTP 

2.What are the elements of JSP scripting?

 Comment, expression, scriptlet, declaration and expression language.

3.What is meant by MVC?

MVC stands for Model View and Controller. It is a design pattern that separates the business logic, presentation logic and data.

4. What is JMS?

 JMS (Java Message Service) is an API that provides the facility to create, send and read messages. It provides loosely coupled, reliable and asynchronous communication.

5) What is a point to point model in JMS?

 In P2P Model, a JMS Receiver or JMS Consumer receives and reads messages from a Queue. In P2P Model, a JMS Message is delivered to one and only one JMS Consumer

6. What is the difference between JavaMail and JMS queue?

JMS is for high-performance, reliable application-to-application messaging. JavaMail is for writing Java applications that send and receive email

7. What type of message is provided by JMS?

JMS provides both types of messaging synchronous. Asynchronous.

8. What are the 4 types of J2EE modules?

  • Application client module.

  •  Web module.

  •  Enterprise JavaBeans module.

  •  Resource adapter module.

9. What is the custom JSP tag?

 Custom tags are user-defined tags. They eliminate the possibility of scriptlet tag and separates the business logic from the JSP page.

10. What are ACID properties?

The ACID properties describe the transaction management ACID stands for Atomicity, Consistency, isolation and durability.

11.Which jsp tag can be used to include directives?

 In JSP, directive is described in <%@ %> tags.

12.What are JSP scripting elements?

 JSP scripting allows you to insert Java code into Java Servlet generated from JSP page. These are the scripting elements: comment, expression, scriptlet, declaration and expression language.

13. What are predefined variables or implicit objects?

These Objects are the Java objects that the JSP Container makes available to the developers in each page and the developer can call them directly without being explicitly declared. JSP Implicit Objects are also called pre-defined variables.

14 How can you set a cookie in JSP?

Call the Cookie constructor with a cookie name and a cookie value, both of which are strings.

15. List out the JSP page.

   <%@ page ... %>

        Defines page-dependent attributes, such as scripting language, error page,                and buffering requirements.

16.Specify the usage of POP

The Post Office Protocol is the mechanism by which the majority of people collect their email. It is then the responsibility of the user to take care of the e-mail by filing it in some logical storage.

17.What is JMS?

 JMS (Java Message Service) is an API that provides the facility to create, send and read messages.

18.Expand SMTP,POP,IMAP

SMTP:simple mail transport protocol

POP:Post Office Protocol

IMAP:Internet Message Access Protocol

19.Specify the usage of SMTP

The Simple Mail Transport Protocol was first proposed back in 1982 and was designed for the delivery of mail messages to servers.

20.Specify the usage of IMAP

The Internet Message Access Protocol is a protocol that many enterprise email servers employ. It offers a far richer set of functions than POP. With POP the premise is that the user is responsible for the storage of email, whereas with IMAP the server assumes this responsibility. IMAP offers a folder structure for the user to interact with and all messages are stored on the server. The user has no need to download email to his or her local machine.

21.Specify the usage of MIME

The Multipurpose Internet Mail Extension defines the translation of and all the rules that are associated with the transmission of binary-based e-mail. Internet mail is fundamentally based on pure American Standard Code for Information Interchange (ASCII) text, and on the whole does not permit non-ASCII data to be used.

22. What are the four major components of Java Mail?

  • Session management

  • Message Manipulation

  • Mail storage and retrieval

  • Transportation.

23. Specify the usage of Session management

A session, in the JavaMail context, is merely used for storing information about the logistics of establishing a connection session with the server. Therefore, it is not uncommon for sessions to be shared among users, if they are all using, say, the same SMTP server.

24.Specify the usage of Message Manipulation.

One of the core features of JavaMail,  is the ability to work with messages. The actual procedure involved in sending an e-mail isn’t that complicated. The JavaMail API offers a rich library of classes to make the construction and deconstruction of mail messages a relatively painless process, and it all starts with javax.mail.Message.

25. Specify the usage of Mail storage and Retrieval

 The JavaMail API deals with the  handling of groups of messages.Messages are organized into folders and these folders are held within a single store. A store must by default have at least one folder in which messages can reside. This requirement allows the JavaMail API to provide a uniform access method across all the different protocols.

26. Specify the usage of Transportation.

The JavaMail API is the class responsible for the delivery of messages, javax.mail.Transport. In the majority of instances, will be using the SMTP protocol for delivery. The Transport class offers the following static method for sending messages 

Transport.send( msg );

27. What are JavaMail core Classes

There are two packages that are used in Java Mail API: javax.mail and javax.mail.internet package. These packages contain many classes for Java Mail API. They are:

  • javax.mail.Session class

  • javax.mail.Message class

  • javax.mail.internet.MimeMessage class

  • javax.mail.Address class

  • javax.mail.internet.InternetAddress class

  • javax.mail.Authenticator class

  • javax.mail.PasswordAuthentication class

  • javax.mail.Transport class

  • javax.mail.Store class

  • javax.mail.Folder class 

5 MARK

1)How Java mail APIs are Integrated into J2EE? Explain.

2) Explain Error pages with suitable example

3) Explain POP, SMTP and IMAP protocols

4) Describe the advantages of JSP over servlet

5) Explain the use of MIME with message make up

6) Discuss about protocols used in Javamail

7) Write the interfaces used in Java message service

8) Develop a simple Login JSP page using java beans

9) How is the database accessed from JSP pages?

10) Discuss about directives in JSP

11) Write note on e-mail client and e-mail server

12) What is J2EE? Explain?

13) Discuss the components of mail

10 MARK

1) Explain briefly Java Messaging Service

2) What are the components of Java mail? Explain

3) Describe briefly JSP scripting elements and directives with suitable example

4) Explain briefly the messaging models with neat diagram

5) Explain JSP scripting elements and directives

6) Discuss the two-phase commit protocol in detail

7) Explain the major components of JMS in detail.

8) Explain the following: (a) JMS (b) Transaction

9) Explain how JSP is used to develop a web-based application. Use a suitable example

10) Explain in detail about J2EE

11) Write short notes on error page in JSP

12) Explain Java messaging services

13) Explain JSP scripting elements

14). Explain how to explore the “Hello world” of Javamail.

15).How to send e-mail and attachments using Javamail API? Explain in detail.


No comments:

Post a Comment