Struts Basic questions and answers
Q23:Can I have more than one struts-config.xml
file?
Ans:Yes. We can have more than one struts-config.xml.A sample configuration in web.xml file would look like this
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<!-- module configurations -->
<init-param>
<param-name>config/exercise</param-name>
<param-value>/WEB-INF/exercise/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/upload</param-name>
<param-value>/WEB-INF/upload/struts-config.xml</param-value>
</init-param>
</servlet>
Struts Objective Questions And Answers
Struts Objective Questions And Answers
Struts Subjective Questions And Answers
Struts Subjective Questions And Answers
Struts Interview Questions And Answers
Struts Interview Questions And Answers
Q24 What is Struts Validator Framework?
Ans: The Valuator Framework is used for server side validation in Struts Framework.The
server side validation of form can be accomplised by sub class of our From
Bean with DynaValidatorForm class.
Q25:What is the role of ActioMapping object in Struts Action class?
Ans: The role of the ActionMapping object to map a particular
Action class.
Q26:What happens internally when actionMappings.findForward("target")
method is called in Action class?
Ans:The actionMappings.findForward("target") method returns
the object of ActionForward. An ActionForward represents a destination to
which the controller, RequestProcessor,might be directed to perform a
RequestDispatcher.forward or
HttpServletResponse.sendRedirect, as a result of processing activities
of an Action class.
Q27 Expalin JSP,Servlet Combination VS Struts Which is better and
how?
Ans:
Q28: Explain ActionForward against JSP:forward.
Ans:jsp:forward is part of JSTL and will be used in JSP pages. It
internally uses RequestDispatcher to forward the request to new jsp or
servlet page. ActionForward is part of Struts framework and is used in Action class. It
internally uses RequestDispatcher to forward the request to ActionServlet.
Struts Basic questions and
answers