Interview Q&A
-
what is difference between servlet container and servlet config?
An HTTP Servlet handles client requests through its service method. The service method supports standard HTTP client requests by dispatching each request to a method designed to handle that request.
-
How does HTTP Servlet handle client requests?
An HTTP Servlet handles client requests through its service method. The service method supports standard HTTP client requests by dispatching each request to a method designed to handle that request.
-
What information does ServletRequest allow access to?
Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, and the names of the remote host that made the request and the server that received it. Also the input stream, as Serv...
-
When a servlet accepts a call from a client, it receives two objects. What are they?
ServletRequest (which encapsulates the communication from the client to the server) and ServletResponse (which encapsulates the communication from the servlet back to the client). ServletRequest and ServletResponse are interfaces defined in...
-
How many JSP scripting elements are there and what are they?
There are three scripting language elements: declarations, scriptlets, expressions.
-
What is session?
The session is an object used by a servlet to track a user's interaction with a Web application across multiple HTTP requests. The session is stored on the server.
-
Difference between GET and POST
In GET your entire form submission can be encapsulated in one URL, like a hyperlink. query length is limited to 255 characters, not secure, faster, quick and easy. The data is submitted as part of URL.
-
What are the common mechanisms used for session tracking?
Cookies SSL sessions URL- rewriting
-
What’s the Servlet Interface?
The central abstraction in the Servlet API is the Servlet interface. All servlets implement this interface, either directly or, more commonly, by extending a class that implements it such as HttpServlet.Servlets > Generic Servlet > HttpSer...
-
Whats the advantages using servlets over using CGI?
Servlets provide a way to generate dynamic documents that is both easier to write and faster to run. Servlets also address the problem of doing server-side programming with platform-specific APIs: they are developed with the Java Servlet AP...
-
What is a servlet?
Servlets are modules that extend request/response-oriented servers,such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a co...
-
What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()
request.getRequestDispatcher(path): In order to create it we need to give the relative path of the resource, context.getRequestDispatcher(path): In order to create it we need to give the absolute path of the resource.
-
Why are JSP pages the preferred API for creating a web-based client program
Because no plug-ins or security policy files are needed on the client systems(applet does). Also, JSP pages enable cleaner and more module application design because they provide a way to separate applications programming from web page desi...
-
What is a Hidden Comment
A comment that documents the JSP page but is not sent to the client. The JSP engine ignores a hidden comment, and does not process any code within hidden comment tags. A hidden comment is not sent to the client, either in the displayed JSP...
-
How is JSP used in the MVC model
JSP is usually used for presentation in the MVC pattern (Model View Controller ) i.e. it plays the role of the view. The controller deals with calling the model and the business classes which in turn get the data, this data is then presente...
-
What is a translation unit?
JSP page can include the contents of other HTML pages or other JSP files. This is done by using the include directive. When the JSP engine is presented with such a JSP page it is converted to one servlet class and this is called a translati...
-
How does JSP handle run-time exceptions
You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page. For example: redirects the browser to the JSP page error.jsp if an uncaught exception is e...
-
What is difference between custom JSP tags and beans
Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. Custom tags and beans accomp...
-
Is JSP technology extensible
Yes, it is. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
-
What is a Declaration
It declares one or more variables or methods for use later in the JSP source file. A declaration must contain at least one complete declarative statement. You can declare any number of variables or methods within one declaration tag, as lon...
-
What is a Scriptlet
A scriptlet can contain any number of language statements, variable or method declarations, or expressions that are valid in the page scripting language. Within scriptlet tags, you can declare variables or methods to use later in the file,...
-
What is the difference between class variable, member variable and automatic(local) variable
class variable is a static variable and does not belong to instance of class but rather shared across all the instances member variable belongs to a particular instance of class and can be called from any method of the class automatic or...
-
What is an Iterator?
Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that t...
-
What is static in java?
Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done...
-
What is final?
A final class can't be extended ie., final class may not be subclassed. A final method can't be overridden when its class is inherited. You can't change value of a final variable (is a constant).
-
What is the difference between a constructor and a method?
A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. A method is an ordinary member function of a c...
-
Difference between Vector and ArrayList?
Vector is synchronized whereas arraylist is not.
-
Difference between HashMap and HashTable?
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map wil...
-
What is HashMap and Map?
Map is Interface and Hashmap is class that implements that.
-
What are pass by reference and passby value?
Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.
-
Explain different way of using thread?
The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.
-
Describe synchronization in respect to multithreading.
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in th...
-
What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to t...
-
What if the main method is declared as private?
The program compiles properly but at runtime it will give "Main method not public." message.
-
What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all...
-
Is There Any DTD File to Validate Atom Feed Files
A DTD (Document Type Definitions) file contains a set of definitions of XML elements and attributes to form a new XML based language. The same DTD file can be used to validate XML files that comply with the new language. Atom feed files ar...
-
What is DTD?
DTD stands for document type definition. it describes elements that appear in the XML document what are its contents and attributes Reply With Quote
-
wsp to http witch part will convert in wap
Actually there is a getway called wap getway works like a converter. it converts wsp request coming from ME to http to access the internet.
-
What Are The Signals Tranferred In GPRS?
GPRS is 2.5 generation of GSM. Radio interface is same as GSM. so i think it also uses the same frequency band and moulation. i.e 900/1800Mhz,GMSK modulation.
-
What is WAP?
Wireless Application Protocol (WAP) is a protocol for transmitting data between servers and clients (usually small wireless devices like mobile phones). WAP is analogous to HTTP in the World Wide Web. Many mobile phones include WAP browser...
-
Explain about the SOAP body element?
This part of the element will contain the message which is intended for the ultimate delivery point. An element can be described inside the body element as a default namespace which indicates about the error message during the process. SOAP...
-
Explain about the actor element?
A SOAP message has to travel a very long distance between its client and server but during the process a part of the message may be intended to be deployed to another destination which is made possible by the SOAP elements actor attribute w...
-
Explain about the SOAP Envelope element?
A SOAP message will have the SOAP element as the root element. SOAP element name space should always have the value of : as that defines the Envelope.
-
What are the elements which should be contained in SOAP message?
Following elements are contained in the SOAP message. 1) An envelope element which identifies and translates the XML document into a SOAP message. 2) A header element is a must as it should contain header message. 3) A body is required w...
-
Explain the difference between RPC and Local calls?
An important difference between Remote call procedure and local call is that remote call can fail often and this occurs without the knowledge of the user. Local calls are easily handled. Another main difficulty lies with the code writing ca...
-
Explain about the role of XML in SOAP?
XML is chosen as a standard format because it was already in use by many large companies and immensely due to its open source nature. A wide variety of tools are available on shelves which ease the process of transition to SOAP. XML can sig...
-
Explain about HTTPS in SOAP?
HTTPS is similar to HTTP but it has an additional layer underneath the internet application layer which makes the data encrypted. This protocol is widely used than IOP or DCOM because those protocols are filtered by firewalls. HTTPS protoco...
-
Explain about Transport methods in SOAP?
Internet application layer is used to transfer messages from one end to another end. Various products have been transported successfully from one end to another end using SOAP. Both SMTP and HTTP are two successful transport protocols used...
-
Explain about Remote call procedure?
Remote call procedure is considered as a very important function in SOAP. In RCP a user (node) sends a request to another node (server) where the information is processes and sent to the user. It immediately sends message across the network...
-
Give an example about the functioning of SOAP?
Consider a real estate database with huge data ranges. If a user wants to search about a particular term, the message with all the required features such as price, availability, place, etc will be returned to the user in an XML formatted do...