In Struts framework, actionServlet acts as a controller and all the requests made by users are controlled by this controller. ActionServlet is based on singleton design patter as only one object needs to be created for this controller class. Multiple threads are created later for each user request.
ContactUs
Why ActionServlet is singleton in Struts?
What are the steps required for setting up validator framework in Struts?
Following Steps are required to setup validator framework in Struts: –
In WEB-INF directory place valdator-rules.xml and validation.xml files.
Enable validation plugin in struts-config.xml files by adding following:
[xml]
<plug-in className=”org.apache.struts.validator.ValidatorPlugIn”>
<set-property property=”pathnames” value=”/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml”/>
</plug-in>
[/xml]
Which technologies can be used at View Layer in Struts?
In Struts, we can use any of the following technologies in view layer:
JSP
HTML
XML/XSLT
WML Files
Velocity Templates
Servlets
What are the conditions for actionForm to work correctly?
ActionForm must fulfill following conditions to work correctly:
It must have a no argument constructor.
It should have public getter and setter methods for all its properties.
Which library is provided by Struts for form elements like check boxes, text boxes etc?
Struts provide HTML Tags library which can be used for adding form elements like text fields, text boxes, radio buttons etc.