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

Multiple choice technology web technology
  1. Yes,always.Spring framework will understand automatically when it will not find applicationcontext.xml

  2. No,never this can happen

  3. Yes,by specifying a <context-param> element named “contextConfigLocation" for the listener class "org.springframework.web.context.ContextLoaderListener"

  4. Yes,if we use it with JSF

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

You can use any custom XML configuration file name instead of applicationContext.xml by defining the contextConfigLocation parameter in web.xml for the ContextLoaderListener.

Multiple choice technology web technology
  1. singleton

  2. prototype

  3. global session

  4. response

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Spring Framework has five standard bean scopes: singleton (default), prototype, request, session, and global session. 'response' is not a valid Spring bean scope. The other three options listed are all valid scopes (singleton and prototype are the most commonly used).

Multiple choice technology web technology
  1. XmlWebApplicationContext

  2. RequestXmlApplicationContext

  3. ClassPathXmlApplicationContext

  4. FileSystemXmlApplicationContext

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Spring provides XmlWebApplicationContext, ClassPathXmlApplicationContext, and FileSystemXmlApplicationContext. There is no standard class named RequestXmlApplicationContext in the Spring Framework.

Multiple choice technology web technology
  1. Global Scope

  2. Application Scope

  3. Session Scope

  4. Request Scope

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JSF (JavaServer Faces) has several built-in scopes: Request Scope, View Scope, Session Scope, and Application Scope. These scopes manage the lifecycle of managed beans. Global Scope is not a standard JSF scope, making option A the correct answer to what is NOT a valid scope.

Multiple choice technology web technology
  1. FacesContext.getCurrentInstance().getViewRoot()

  2. FacesContext.getCurrentInstance().responseComplete()

  3. FacesContext.getCurrentInstance().renderResponse()

  4. FacesContext.getCurrentInstance().release()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The renderResponse() method on FacesContext tells JSF to skip to the Render Response phase of the lifecycle, effectively causing the page to be redisplayed. This is commonly used in value change listeners when you want to update the UI after a value change.

Multiple choice technology web technology
  1. Setter Injection

  2. Method Injection

  3. Constructor injection

  4. Interface Injection

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

Spring supports two main types of dependency injection: Setter Injection (A) and Constructor Injection (C). Method Injection (B) and Interface Injection (D) are not standard DI types in Spring. Spring's IoC container primarily uses setter and constructor injection patterns.

Multiple choice technology web technology
  1. Yes,always.Spring framework will understand automatically when it will not find applicationcontext.xml

  2. No,never this can happen

  3. Yes,by specifying a <context-param> element named “contextConfigLocation" for the listener class "org.springframework.web.context.ContextLoaderListener"

  4. Yes,if we use it with JSF

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Spring allows custom XML configuration files by specifying the contextConfigLocation context parameter. The ContextLoaderListener loads the specified files instead of the default applicationcontext.xml. Option A is wrong because Spring doesn't automatically find other files. Option B is wrong because it's possible. Option D is irrelevant to Spring.

Multiple choice technology web technology
  1. XmlWebApplicationContext

  2. RequestXmlApplicationContext

  3. ClassPathXmlApplicationContext

  4. FileSystemXmlApplicationContext

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Spring's common ApplicationContext implementations include ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, and XmlWebApplicationContext. 'RequestXmlApplicationContext' is not a real implementation - this is likely mixing up the concept of request scope beans with ApplicationContext types.

Multiple choice technology web technology
  1. Global Scope

  2. Application Scope

  3. Session Scope

  4. Request Scope

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JSF/CDI uses standard scopes like @RequestScoped, @SessionScoped, @ApplicationScoped, @ViewScoped, @FlowScoped, and @ConversationScoped. 'Global Scope' is not a standard scope in JSF or CDI. Application Scope covers application-wide singletons, making Global Scope redundant and non-standard.

Multiple choice technology web technology
  1. FacesContext.getCurrentInstance().getViewRoot()

  2. FacesContext.getCurrentInstance().responseComplete()

  3. FacesContext.getCurrentInstance().renderResponse()

  4. FacesContext.getCurrentInstance().release()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To reload the page after a ValueChangeListener is invoked, call renderResponse() on FacesContext. This method instructs JSF to skip to the Render Response phase, effectively reloading the current view. responseComplete() ends processing without rendering, and getViewRoot() just retrieves the view root without triggering a reload.

Multiple choice technology programming languages
  1. Netscape invented JavaScript as a stripped-down "lite" version of Java

  2. Java borrowed ideas from JavaScript and made it a full-fledged programming language

  3. They both originate from the same research at Sun Microsystems

  4. There is none; it's all just marketing

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Java and JavaScript are entirely distinct languages with different designs, use cases, and execution environments. The name similarity was purely a marketing decision by Netscape to capitalize on the popularity of Java at the time.

Multiple choice technology platforms and products
  1. Start in level 9 debug mode but does not write any server log information

  2. Start in level 9 debug mode and write all server log information to the screen

  3. Start in level 9 debug mode and write all of the server log information to the Unix syslog or NT event log

  4. There is no level 9 debug mode so the server will fail to start

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The -debug 9 parameter starts the webMethods Integration Server in level 9 debug mode, and -log none redirects the server log output to standard output (the screen) instead of writing it to the standard log file.

Multiple choice technology platforms and products
  1. webMethods6\IntegrationServer\lib

  2. webMethods6\IntegrationServer\lib\jars

  3. webMethods6\IntegrationServer\bin\jars

  4. webMethods6\IntegrationServer\bin

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In webMethods Integration Server, external Java classes such as JDBC driver JAR files must be placed in the webMethods6\IntegrationServer\lib\jars directory so they are automatically loaded into the server's classpath upon startup.

Multiple choice technology platforms and products
  1. 5555, 8021, 80, and/or 443 only

  2. Port numbers greater than or equal to 1000 only

  3. Any valid port number not already in use

  4. Ports 21, 80, 443, and any port number above 1000

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

To solve this question, the user needs to have knowledge of webMethods Integration Server and how it handles communications.

Option A is incorrect. While ports 5555, 8021, 80, and 443 can be used for listeners, they are not the only ports available for use.

Option B is incorrect. Port numbers greater than or equal to 1000 are not the only ports available for use.

Option C is correct. The webMethods Integration Server can have an active listener on any valid port number that is not already in use.

Option D is incorrect. While ports 21, 80, and 443 can be used for listeners, any port number above 1000 is not guaranteed to be available for use.

Therefore, the answer is: C. Any valid port number not already in use.