Java Web Frameworks - JSF and Struts 2

Quiz covering JavaServer Faces (JSF) and Apache Struts 2 web application frameworks, including configuration, validation, action classes, and request processing lifecycle.

20 Questions Published

Questions

Question 1 True/False

The tag <f:view> has a performance overhead so you should reduce the scope where possible?

  1. True
  2. False
Question 2 True/False

Is this valid JSF JSP code ? <%@ taglib uri="http://java.sun.com/jsf/html";; prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core";; prefix="f" %> <f:view> <h:commandButton action="#{bean.dosomething}" value="Do something"/>

  1. True
  2. False
Question 3 True/False

Can we use updateActionListener in SelectBooleanCheckbox tag?

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

What property of the <h:messages> tag needs to be set to true in order to display only the messages that have not been associated with a component ?(enter the name, case sensitive)

  1. globalOnly
  2. id
  3. forceId
  4. rendered
Question 5 True/False

The method processDecodesWithoutValidation(FacesContext context) forces all components to execute the Apply Request Values phase and return an error message to the client if a RuntimeException is thrown, but it does not process validation for immediate components.

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

What is the first entry point in the request processing life cycle of Struts 2 Framework

  1. Servlet
  2. Servlet Filter
  3. JSP
  4. None of The Above
Question 7 Multiple Choice (Single Answer)

How are html form input parameters passed in case of Struts 2

  1. ActionForm
  2. Action
  3. All of the Above
  4. None of the Above
Question 8 Multiple Choice (Single Answer)

What are the type of exceptions handled by Exception handler in Struts 2

  1. Unchecked
  2. Checked
  3. All of the Above
  4. None of the Above
Question 9 Multiple Choice (Single Answer)

To pass HttpServletRequest instance to Action, which of the following interfaces/Classes need to be implemented.

  1. ServletRequestAware
  2. ServletResponseAware
  3. ActionSupport
  4. All of them
Question 10 True/False

Action Classes in Struts 2 have to extend ActionSupport.

  1. True
  2. False
Question 11 True/False

Action classes have to extend ActionSupport for declarative validation in struts 2

  1. True
  2. False
Question 12 Multiple Choice (Single Answer)

In a struts 2 implementation, one of the name of the action is SampleAction and corresponding name of the Class is SampleClass. Please identify the correct validation xml name for the Action.

  1. SampleAction-validation.xml
  2. SampleClass-validation.xml
  3. All Of the above
  4. None of the above
Question 13 True/False

Configuration file Name (struts.xml) can be changed in Struts 2 as was the case in Struts 1.

  1. True
  2. False
Question 14 True/False

Action Classes in Struts 2 are instantiated on per request basis

  1. True
  2. False
Question 15 True/False

Default interceptor stack containing validation interceptor, workflow inteceptor and others can be customized

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

Only value of which UI component can be validated?

  1. UIInput or component that extends UIInput
  2. UIOutput or component that extends UIOutput
  3. UICommand or component that extends UICommand
  4. UIOutputLink or component that extends UIOutputLink
Question 17 True/False

A validator in JSF is only designed to validate one component, so in general just one field, and validating multiple fields is tricky.

  1. True
  2. False
Question 18 True/False

JavaServer Faces technology provides standard error messages that display on the page when conversion or validation fails.

  1. True
  2. False
Question 19 True/False

If an error occurs inside a convertor used to convert the value entered in a inputText field, than the isValid method of the field returns false.

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

Which section of the Config.Web file is used for storing a list of authorized users?

  1. Authentication
  2. Authorization
  3. Security Policy
  4. Prerequisition