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
-
Mail Service
-
Simple Mail Protocol
-
Java Mail Service
-
Mail Protocol
C
Correct answer
Explanation
JavaMail API (Java Mail Service) is the standard library for sending email from Java applications, including servlets. It provides classes like Session, Message, and Transport for creating and sending emails through SMTP servers.
-
Servlets
-
Jsp
-
Perl pages
-
Html
A
Correct answer
Explanation
Among executable web technologies, Servlets offer high performance because they are loaded once and run as lightweight threads within the web container. This avoids the overhead of spawning new processes (like Perl/CGI) or the initial translation and compilation delay associated with JSPs on their first invocation.
-
response.setparameter () method
-
response.getparameter () method
-
request.setparameter () method
-
request.getparameter () method
D
Correct answer
Explanation
To retrieve data sent from an HTML page (like form inputs or query parameters), the servlet uses request.getParameter(String name). Methods on the response object are used for sending data back to the client, and there is no standard setParameter() method on the HTTP request object.
B
Correct answer
Explanation
Static variables are stored in the JVM memory space and are shared only within the same JVM instance and classloader. Since the servlet is deployed on multiple separate servers, each runs in its own JVM, meaning they do not share the static variable, making the statement false.
-
HTTPRequest.setUserName()
-
HttpServletRequest.getUserName()
-
HTTPResponse.setUserName()
-
HTTPResponse.getUserName()
-
Action
-
ActionServlet
-
HttpServlet
-
Servlet
-
None of the above
A,B
Correct answer
Explanation
In the Struts 1.3 framework, Action is a core class that encapsulates business logic and request handling, while ActionServlet is the central controller servlet that receives all requests and delegates them to appropriate Action classes. HttpServlet is a generic Java class that ActionServlet extends, and Servlet is an interface - these are not Struts-specific core classes.
-
ActionServlet
-
ActionJsp
-
ActionClass
-
Action
A
Correct answer
Explanation
ActionServlet is the core controller class of the Struts 1 framework, acting as the central servlet that intercepts incoming client requests and routes them to appropriate actions. Other options like ActionClass or ActionJsp are either incorrect terms or helper structures, not the central core class.
-
backword overflow
-
forward overflow
-
Single controller servlet
-
no forward overflow
C
Correct answer
Explanation
A key drawback of Struts framework is its single controller servlet architecture (ActionServlet). All requests must route through one servlet, which can create bottlenecks and scaling issues in high-traffic applications. Modern frameworks like Spring MVC support multiple controllers. The other options (backward/forward overflow) are not recognized drawbacks of Struts.
A
Correct answer
Explanation
The Model component includes business logic and data representation, commonly implemented as JavaBeans. HTML, Servlets, and JSPs belong to the View or Controller layers, not the Model.
C
Correct answer
Explanation
The View component handles presentation and is typically implemented using JSP (JavaServer Pages). Beans and EJBs belong to the Model, while Servlets are Controllers.
C
Correct answer
Explanation
The Controller component processes user requests and coordinates Model and View, typically implemented as Servlets. HTML is markup, JSPs are View components, and Beans are Model components.
A
Correct answer
Explanation
MVC2 architecture uses a Front Controller pattern where a single servlet (the controller) receives all requests and dispatches them to appropriate handlers. This centralizes request processing.
-
information sent by web server
-
information sent by servlet
-
information sent by browser
-
information sent by jsp
A
Correct answer
Explanation
Cookies are small pieces of information sent by the web server to the client browser, which are then stored and sent back with subsequent requests. While browsers store and send cookies, they originate from the server.
-
Mail Service
-
Simple Mail Protocol
-
Java Mail Service
-
Mail Protocol
C
Correct answer
Explanation
JavaMail API (Java Mail Service) is the standard Java library for sending emails from applications including Servlets. 'Mail Service' and 'Mail Protocol' are too generic, and 'Simple Mail Protocol' refers to SMTP which is used under the hood.
-
Servlets
-
Jsp
-
Perl pages
-
Html
A
Correct answer
Explanation
Servlets offer the highest performance because they are pre-compiled Java classes executing directly on the JVM. JSPs are compiled to servlets on first access (adding overhead), Perl is interpreted, and HTML is static markup.