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
-
pub.flow:catchException
-
pub.flow:catchError
-
pub.schema:validatePipeline
-
pub.flow:getLastError
D
Correct answer
Explanation
pub.flow:getLastError retrieves details about the last exception that occurred during flow service execution, making it the primary exception handling service. pub.flow:catchException handles exceptions but getLastError provides exception details.
-
Change the content type of the output returned to the client of a service invoke
-
Return an XML message in response to an XML HTTP POST request
-
Display an HTML message in a browser
-
Return a text document that has been previously formatted with an output template
D
Correct answer
Explanation
The pub.flow:setResponse service in webMethods can change content types, return XML/HTML messages, and display content in browsers. However, returning a pre-formatted text document from an output template is not within its scope - setResponse handles response configuration but doesn't retrieve template-formatted documents.
-
Control access to a Flow service
-
Store encrypted Access Control Lists (ACLs)
-
Restrict access to DSP, HTML and XML files
-
Control Administrator access to the Integration Server
C
Correct answer
Explanation
The .access file in webMethods Integration Server controls access to web-facing resources like DSP (webMethods DSP pages), HTML files, and XML files. It does NOT control Flow service access (handled by ACLs), store encrypted ACLs, or control Administrator access.
-
An IData pipeline object is instantiated
-
A content-handler is invoked
-
A session is created
-
The client posting the data is authenticated
D
Correct answer
Explanation
When HTTP POST data arrives at webMethods Integration Server, authentication (if configured) typically happens first to establish who is making the request. Only after authentication does the server create a session, invoke content handlers, or instantiate pipeline objects.
-
Web Client
-
Mobile Web Client
-
Wireless Web Client
-
Dedicated Web Client
A,C
Correct answer
Explanation
Siebel Web Clients and Wireless Web Clients connect to the Siebel Application Object Manager via a web server (using the Siebel Web Server Extension). Dedicated Web Clients connect directly to the database.
-
JSP File
-
Plain text file
-
SERVLET
-
All of the above
D
Correct answer
Explanation
The action is versatile and can include output from various sources: JSP files (for dynamic content generation), plain text or HTML files (for static content), and servlets (for programmatic output). This makes it a powerful tool for composing pages from multiple components.
-
Using the <jsp:readParam/> action
-
Using the <jsp:getParam/> action
-
Use the request.getParameter() method
-
Use the response.getParameter() method
C
Correct answer
Explanation
Parameters passed via within a action become standard request parameters in the included page. The included page accesses these using the familiar request.getParameter() method, just like parameters from an HTML form or URL query string.
-
Unmatched bracket in for statement
-
Flush attribute must be false
-
Keyword 'file' should be used instead of 'page' in the <jsp:forward/> action
-
Actions cannot be used within scriptlet blocks
D
Correct answer
Explanation
JSP actions like are XML-based syntax that must be used outside of scriptlet blocks (<% ... %>). Within scriptlets, you should use programmatic equivalents like response.sendRedirect() or request.getRequestDispatcher().forward(). The syntax shown tries to mix XML action tags inside Java code blocks, which is invalid.
-
<jsp:synchronize name="BeanName" />
-
<jsp:setProperty name="BeanName" property="" />
-
<jsp:setProperty name="BeanName" property="*" />
-
<jsp:setProperty name="BeanName" property="All" />
C
Correct answer
Explanation
Using property="*" in automatically matches all request parameter names to bean property names. If the form has fields named firstName and lastName, and the bean has properties with the same names, they're populated automatically. This is a convenient shortcut for form-to-bean synchronization.
-
web.xml
-
servlet.mappings
-
servlet.xml
-
Servlet.java
A
Correct answer
Explanation
The web.xml file is the standard deployment descriptor for Java web applications. It contains servlet mappings, servlet definitions, and other configuration elements. Servlet.mappings and servlet.xml are not standard files.
-
True
-
False
-
Can't say
-
None of these
A
Correct answer
Explanation
Servlets and JSP are widely adopted Java technologies for web development. All major application servers (Tomcat, WebSphere, WebLogic, JBoss) and web servers (Apache with modules, IIS) support them either natively or through plugins.
-
java.servlet
-
javax.servlet
-
.servlet
-
All are same
B
Correct answer
Explanation
To solve this question, the user needs to know about the Java Servlets API and its interface.
The correct answer is:
B. javax.servlet
Explanation:
All the servlets must implement the Servlet interface of the javax.servlet package. The javax.servlet package contains a number of interfaces and classes that define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container. The javax.servlet package provides the base classes for defining HTTP servlets. Thus option B is correct.
Option A is incorrect because there is no package named java.servlet.
Option C is incorrect because the option is incomplete and doesn't provide the package name.
Option D is incorrect because there is only one correct option, and that is option B.
Therefore, the answer is: B. javax.servlet
-
True
-
False
-
Not always
-
None of these
B
Correct answer
Explanation
HTTP GET and POST are defined from the client's perspective. GET requests data FROM a server, POST sends data TO a server. The statement reverses this - it claims GET gets from a client (wrong) and POST posts to a client (wrong).
-
HttpServletResponce
-
HttpRequest
-
ServletRequest
-
HttpServletRequest
D
Correct answer
Explanation
The servlet container creates an HttpServletRequest object representing the client request and passes it to the service() method (which then delegates to doGet(), doPost(), etc.). This object contains request metadata, parameters, headers, and session info.
-
CLIENT
-
SERVER
-
INTERNET
-
IN LOCAL PC
B
Correct answer
Explanation
Servlets run within a servlet container or web server (like Tomcat). The client (browser) cannot directly access servlet code - it makes HTTP requests to the server, which executes the servlet and returns the response.