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.
Questions
The tag <f:view> has a performance overhead so you should reduce the scope where possible?
- 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"/>
- True
- False
Can we use updateActionListener in SelectBooleanCheckbox tag?
- True
- False
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)
- globalOnly
- id
- forceId
- rendered
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.
- True
- False
What is the first entry point in the request processing life cycle of Struts 2 Framework
- Servlet
- Servlet Filter
- JSP
- None of The Above
How are html form input parameters passed in case of Struts 2
- ActionForm
- Action
- All of the Above
- None of the Above
What are the type of exceptions handled by Exception handler in Struts 2
- Unchecked
- Checked
- All of the Above
- None of the Above
To pass HttpServletRequest instance to Action, which of the following interfaces/Classes need to be implemented.
- ServletRequestAware
- ServletResponseAware
- ActionSupport
- All of them
Action Classes in Struts 2 have to extend ActionSupport.
- True
- False
Action classes have to extend ActionSupport for declarative validation in struts 2
- True
- False
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.
- SampleAction-validation.xml
- SampleClass-validation.xml
- All Of the above
- None of the above
Configuration file Name (struts.xml) can be changed in Struts 2 as was the case in Struts 1.
- True
- False
Action Classes in Struts 2 are instantiated on per request basis
- True
- False
Default interceptor stack containing validation interceptor, workflow inteceptor and others can be customized
- True
- False
Only value of which UI component can be validated?
- UIInput or component that extends UIInput
- UIOutput or component that extends UIOutput
- UICommand or component that extends UICommand
- UIOutputLink or component that extends UIOutputLink
A validator in JSF is only designed to validate one component, so in general just one field, and validating multiple fields is tricky.
- True
- False
JavaServer Faces technology provides standard error messages that display on the page when conversion or validation fails.
- 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.
- True
- False
Which section of the Config.Web file is used for storing a list of authorized users?
- Authentication
- Authorization
- Security Policy
- Prerequisition