Thursday, September 11, 2014

JSF and Strut questions and anwsers


  1. Struts was first developed

    1. in an online exchange between several open source developers

    2. over a long holiday weekend(TRUE)

    3. as a commercial package



  2. The reset method on an ActionForm

    1. Sets all properties to their initial value

    2. Sets all properties to null

    3. Repopulates all properties from the request parameters

    4. None of the above(TRUE)



  3. Each Struts Action element is uniquely identified by its

    1. Input attribute

    2. Name attribute

    3. Page attribute

    4. Path attribute(TRUE)



  4. The name of the Application Resources file is set by the servlet init-param named

    1. Application(TRUE)

    2. Resources

    3. ApplicationResources

    4. messages



  5. The validating init-param of the ActionServlet is used to

    1. Bypass calls to the ActionForm validate method

    2. Bypass validation of the Struts configuration file(TRUE)

    3. Generate an error message if an unknown message key is used



  6. To specify an ActionMapping to use when a request doesn't match any other mapping, you can

    1. Use an asterisk for the path property

    2. Set the "default" property of the mapping to "true"

    3. Set the "unknown" property of the mapping to "true"(TRUE)

    4. Set the "missing" init-param of the ActionServlet to the mapping's path



  7. In Struts 1.1, you can change how Struts populates a form by

    1. Overriding the populate method of the ActionForm

    2. Overriding the processPopulate method of the Request Processor(TRUE)

    3. Overriding the populateBean method of the ActionMapping



  8. The < bean:write > tag is:

    1. Always converts HTML markup to entity equivalents, like &lt;

    2. Never converts HTML markup to entity equivalents

    3. Converts markup when filter=true(TRUE)

    4. Converts markup when markup=false



  9. From a MVC perspective, Struts provides the

    1. Model

    2. View

    3. Controller(TRUE)



  10. Struts Framework is well suited for application of ____ size.

    1. Small

    2. Any(TRUE)

    3. Average

    4. Very small



  11. MVC is :

    1. Mode-View-Controller

    2. Model-View-Converter

    3. Model-Viewer-Controller

    4. Model-View-Controller(TRUE)



  12. What is Action Class ?

    1. The Action Class is a wrapper around the business logic and is a part of Model(TRUE)

    2. Nothing special about the Action class

    3. Action Class is a wrapper around the Internet logic

    4. None of the above



  13. An ActionForm is a JavaBean which extends the:

    1. struts.action.ActionForm(TRUE)

    2. apache.struts.action.ActionForm

    3. action.ActionForm

    4. ActionForm



  14. Use the following command (tag) to display the error on the jsp page:

    1. < html:errors/ >

    2. < html:errors/ >(TRUE)

    3. < errors / >

    4. < html=errors/ >



  15. What of following features can _not_ be configured in the JSF configuration file?

    1. Navigation rules

    2. Managed Beans

    3. Custom components

    4. Application Name(TRUE)



  16. In JSF - Which tag must enclose all other tags on a Faces JSP page?

    1. < f:faces >

    2. < f:view >(TRUE)

    3. < h:jsf >

    4. < h:view >



  17. In JSF - Why does the HtmlForm component render a <hidden> field?

    1. Command events

    2. Submit events

    3. Action events(TRUE)

    4. Click events



  18. In JSF - Why does the HtmlForm component render a < hidden > field

    1. To keep track of its identifier

    2. To keep track of the components in tree

    3. To set its submitted property(TRUE)

    4. For JavaScript integration



  19. What are the main features of JSF ? ( Choose many )

    1. Page navigation specification(TRUE)

    2. Standard user interface components like input fields, buttons, and links(TRUE)

    3. Read xml file

    4. Easy error handling(TRUE)



  20. In JSF - Components can be nested within another component

    1. True(TRUE)

    2. False




Next 20 -->

  1. Which one of the following tags renders a single radio button?

    1. <h:selectBooleanCheckbox>

    2. <h:selectOneRadio>

    3. <h:selectOneCheckbox>

    4. <h:selectManyCheckbox>



  2. The tag library that allows you to keep common content in a Web application, at a common location and insert it where necessary is

    1. HTML tag library

    2. Logic tag library

    3. Bean tag library

    4. Template tag library



  3. The tag used to create an input field that is not visible to the user is _______________.

    1. <h:inputSecret>

    2. <h:inputHidden>

    3. <h:inputPassword>

    4. <h:inputText>



  4. ______________ class is used to uniquely represent a locale of a country.

    1. faces.render.Locale

    2. util.Locale

    3. faces.context.Locale



  5. Creating and using a custom converter requires implementing _____________ and _____________ methods provided by Converter interface.

    1. getObject()

    2. getAsObject()

    3. getAsString()

    4. getString()



  6. It is possible to have more than one Faces configuration file.

    1. True

    2. False



  7. ________ classplays the role of the controller and is responsible for handling all the requests.

    1. Action

    2. ActionServlet

    3. RequestProcessor

    4. Plugin



  8. The tag used to create a text box to accept a password is _______________.

    1. <h:inputSecret>

    2. <h:inputHidden>

    3. <h:inputPassword>

    4. <h:inputText>



  9. Which of the following UI Component acts as a container for all other components?

    1. UIParameter

    2. UIForm

    3. UIViewRoot

    4. UISelectItem



  10. Which of the following statements are true about the reset() method of ActionForm class?

    1. Sets all properties to their initial value

    2. Sets all properties to null

    3. Repopulates all properties from the request parameters

    4. None of the above



  11. _______________________ declares a set of rules that define the next view for the user based on his/her actions.

    1. JSF Navigation Model

    2. JSF View Model

    3. JSF Forward Model

    4. JSF Model



  12. The file that provides a set of utility classes and interfaces that handle data structures used to store data in an application is _________.

    1. commons-beanutils.jar

    2. commons-collections.jar

    3. commons-digester.jar

    4. commons-logging.jar



  13. Which method of ActionServlet class maps the servlet name to a URL in the Web application?

    1. init()

    2. save()

    3. addmapping()

    4. addServletMapping()



  14. The JSF tag used to show all the error messages in a JSP page is ____________.

    1. <h:message>

    2. <h:messages>

    3. <f:messages>

    4. <f:message>



  15. Which one of the following JSF expressions, references an application's context path?

    1. #{contextPath}

    2. #{requestContextPath}

    3. #{facesContext.externalContext.requestContextPath}

    4. ${request.contextPath}



  16. Each Struts Action element is uniquely identified by its __________.

    1. Input attribute

    2. Name attribute

    3. Path attribute

    4. Page attribute



  17. Which one of the following events is generated by the <h:commandButton> tag of JSF ?

    1. Command event

    2. Submit event

    3. Action event

    4. Click event



  18. Which one of the following Action classes provides a mechanism for switching between modules in a modularized Struts application?

    1. SwitchAction

    2. DispatchAction

    3. IncludeAction

    4. LocaleAction



  19. The Struts class which handles the actual execution of the request is ________.

    1. ActionForward

    2. Action

    3. RequestProcessor

    4. ActionServlet



  20. The Struts tag used to display the error in the JSP page is ______________.

    1. <html:errors/>

    2. <html:errors>

    3. <errors>

    4. <html=errors>




Next 13 (sun)

  1. Struts was first developed

    1. in an online exchange between several open source developers

    2. over a long holiday weekend

    3. as a commercial package



  2. The reset method on an ActionForm

    1. Sets all properties to their initial value

    2. Sets all properties to null

    3. Repopulates all properties from the request parameters

    4. None of the above (do nothing)



  3. Each Struts Action element is uniquely identified by its

    1. Input attribute

    2. Name attribute

    3. Page attribute

    4. Path attribute



  4. The name of the Application Resources file is set by the servlet init-param named

    1. application

    2. resources

    3. ApplicationResources

    4. messages



  5. The validating init-param of the ActionServlet is used to

    1. Bypass calls to the ActionForm validate method

    2. Bypass validation of the Struts configuration file

    3. Generate an error message if an unknown message key is used



  6. To specify an ActionMapping to use when a request doesn't match any other mapping, you can

    1. Use an asterisk for the path property

    2. Set the "default" property of the mapping to "true"

    3. Set the "unknown" property of the mapping to "true"

    4. Set the "missing" init-param of the ActionServlet to the mapping's path



  7. If you have created a custom ActionMapping subclass with the property "service", you can initialize the value to "selectRecord" using

    1. <init-property name="service" value="selectRecord"/>

    2. <set-property property="service" value="selectRecord"/>

    3. <put-field key="service" content="selectRecord"/>



  8. In Struts 1.1, you can change how Struts populates a form by

    1. Overriding the populate method of the ActionForm

    2. Overriding the processPopulate method of the Request Processor

    3. Overriding the populateBean method of the ActionMapping



  9. The <bean:write> tag is:

    1. Always converts HTML markup to entity equivalents, like &lt;

    2. Never converts HTML markup to entity equivalents

    3. Converts markup when filter=true

    4. Converts markup when markup=false



  10. To prevent possible security issues with the <html:password> tag, you should

    1. Call the reset method if validation fails

    2. Set the tag's redisplay property to false

    3. Set the tag's reset property to false

    4. Use a plain html tag instead



  11. To localize Tiles, you can

    1. Create separate configuration files for each locale

    2. Specify an locale for a definition

    3. Either A or B



  12. To localize Validator forms, you can

    1. Create separate configuration files for each locale

    2. Specify a locale for a form-set

    3. Either A or B



  13. From a MVC perspective, Struts provides the

    1. Model

    2. View

    3. Controller




Next 20 -->> 20 question_3

No comments:

Post a Comment

Translate