Struts Quiz
Struts Quiz - 3                    

« 1 »


1. reset() method signature in ActionForm:

a) public ActionErrors reset(ActionMapping mapping, HttpServletRequest request)
b) public ActionError reset(ActionMapping mapping, HttpServletRequest request)
c) public void reset(ActionMapping mapping, HttpServletRequest request)
d) None of the above

2. Correct validate() method is:
a) public ActionError validate(ActionMapping mapping, HttpServletRequest request)
b) public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
c) public ActionError validate(HttpServletRequest request, HttpServletResponse response)
d) None of the above
Wrong! Try again.
Wrong!
The correct answer is b) public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
Correct!
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)

3. The correct execute method of Action class:
a) public void execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException
b) public ActionForward execute (ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response) throws SevletException, Exception
c) public ActionForward execute (ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response) throws SevletException, IOExpection
d) public ActionForward execute (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
Wrong! Try again..
Wrong!
The correct answer is d) public ActionForward execute (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception.
Correct!
public ActionForward execute (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception

4. The class instantiates ActionForm and puts it in appropriate scope based on scope tag
a) ActionServlet
b) Action
c) RequestProcessor
d) HttpRequest
Wrong! Try again..
Wrong!
The correct answer is c) RequestProcessor
Correct!
RequestProcessor

5. If validate="true" in struts-config.xml action tag then the sequence of execution is
a) validate() method of ActionForm, if error return to error.jsp
b) validate() method of ActionForm, if error return to jsp mentioned in input tag
c) validate() method of ActionForm, execute() of Action, if error return to jsp mentioned in input tag
d) None of the above
Wrong! Try again..
Wrong!
The correct answer is b) validate() method of ActionForm, if error return to jsp mentioned in input tag
Correct!
validate() method of ActionForm, if error return to jsp mentioned in input tag

6. Correct validate() method :
a) public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
b) public ActionError validate(ActionMapping mapping, HttpServletRequest request)
c) public ActionError validate(HttpServletRequest request, HttpServletResponse response)
d) None of the above
<--Previous