Computer Knowledge
Java Enterprise and Web Technologies
2,279 Questions
Java enterprise and web technologies questions focus on J2EE architecture, web services like SOAP, and servlet functionalities. These topics frequently appear in IT officer and specialist scale examinations. Regular practice ensures familiarity with enterprise application components.
HttpServlet methodsSOAP and web servicesEJB architecture rolesJ2EE componentsJSP servlet callingUDDI concepts
Java Enterprise and Web Technologies Questions
-
Input scalability
-
RMAN pipe interface
-
DOM interface
-
DebuggerCallback interface
-
Wireless telephony application
C
Correct answer
Explanation
This interface is a platform and language neutral interface that allows programs and scripts to dynamically access and update the contents of the document.
-
Web browser from Sun Microsystem
-
HTML Editor
-
Java Editor
-
Java Compiler
A
Correct answer
Explanation
HotJava was an early web browser developed by Sun Microsystems, notable for being the first to support Java applets. It showcased the capabilities of the Java programming language in a web environment.
-
take and give
-
GET and POST
-
init and start
-
init and GET
B
Correct answer
Explanation
HTTP requests in servlets are primarily handled via GET and POST methods.
-
loading
-
linking
-
initialization
-
none of the above
-
javap
-
a applet
-
beam
-
java servlet
A
Correct answer
Explanation
javap is the standard Java class file disassembler provided with the JDK.
-
This is an interface implemented by the servlet.
-
This is an abstract class which extends the servlet interface.
-
The SingleThreadModel ensures that the servlet will handle one request at a time.
-
The SingleThreadModel does not have any method.
-
None of these
A
Correct answer
Explanation
SingleThreadModel is an interface used to provide the synchronisation among the servlets.
-
ServletConfig interface is used to pass the information from the servlet container to the servlet during the servlet initialisation.
-
The getInitParameter() method returns null if the parameter does not exist.
-
ServletContext object is an interface between the servlet container and a servlet.
-
The only ServletContext object should be in a web application.
-
None of these
E
Correct answer
Explanation
All the statements are correct.
-
This is an abstract class which extends the servlet interface.
-
It provides protocol independent servlet.
-
This class has getServletInfo(), getServletName() and getInitParameterNames() methods.
-
This class has getServletInfo(), getServletName() and getValue() methods.
-
GenericServlet class implements servlet, ServletConfig and serialisable interfaces.
D
Correct answer
Explanation
The getValue() method is not present in the GenericServlet class.
-
The javax.Servlet package defines the various exceptions.
-
A ServletException is known as the generic exception.
-
The getRootCause method returns the cause of ServletException.
-
The UnavaiableException determines that the servlet or filter is not available.
-
The javax.servlet.error.exception gives information about exception type which can be stored and analysed after storing in a java.lang.Class data type.
E
Correct answer
Explanation
This is an incorrect statement.
-
It is an abstract class which provides the number of methods to obtain the various runtime objects of the JSP page.
-
The instance of JspFactory container class is created by the JSP container.
-
It is an implicit object.
-
All of the above
-
Only (1) and (2)
E
Correct answer
Explanation
These are correct statements about JspFactory method.
-
SC_FORBIDDEN method produces predefined error messages like HTTP error 403.
-
We can send a custom error message for the error message in SC_FORBIDDEN method.
-
HttpServletResponse allows to send the error message in the servlet code.
-
HtttpServletResponse interface provides protocol specific methods.
-
There can be many objects of a servlet created for a request.
E
Correct answer
Explanation
Only one object is created at the time of first request by servlet or web container.
-
The class implementing this interface determines the notification about the sessions.
-
The class implementing this interface determines the notification of changes to the HttpSession object's attribute.
-
This interface defines a session specific to the user requesting the servlet.
-
Both (1) and (2)
-
None of these
B
Correct answer
Explanation
This is correct about HttpSessionAttributeListener interface.
-
This class provides notifications in the ServletContext object.
-
The contextDestroyed() method determines whether the servlet container is shut down.
-
The contextInitialized() method determines that the web application is ready to service the request.
-
All of the above
-
Only (1) and (3)
D
Correct answer
Explanation
These are correct statements.
-
Buffering is used to enhance the performance of the servlet.
-
We can change the default buffer size.
-
The default buffer size is 8.192 characters.
-
The output of the browser cannot be sent until the servlet process is finished or the buffer is full.
-
All of the above
E
Correct answer
Explanation
All are correct statements.
-
The class implementing this interface determines the notification about the sessions.
-
The class implementing this interface determines the notification of changes to the HttpSession object's attribute.
-
This interface defines a session specific to the user requesting the servlet.
-
Both (1) and (2)
-
None of these
A
Correct answer
Explanation
The HttpSessionActivateListener interface works for that.