Computer Knowledge
Java Enterprise and Web Technologies
2,183 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
-
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.
-
It is used to provide a reusable combination of different server components.
-
It provides support to IIS specific languages.
-
It is used to create dynamic and powerful Web-based business solutions.
-
It is a mixture of text and HTML tags.
-
All of these
-
SSI is limited to some extent.
-
These files has information about storage of application specific functions and procedures.
-
It has the properties to store any of the object's attributes.
-
It defines the execution environment in networking medium.
-
Options 1 and 2
E
Correct answer
Explanation
These are correct statements.
-
Request
-
Response
-
Server
-
Session
-
Option 2 and 3
C
Correct answer
Explanation
Server controls the activities of Internet Information Server and provide the related details.
-
Response
-
Request
-
Entity
-
PUT
-
OPTIONS
B
Correct answer
Explanation
This HTTP message request is the one that is sent from a client to a server and includes the method to be applied to the resource, the identifier of the source and the protocol version in use.