Monday, March 31, 2008

STRUTS iNTERVIEW QUESTIONS

Q.What is the difference between ActionErrors and ActionMessages?

There is no differnece between these two classes.All the behavior of ActionErrors was copied into ActionMessages and vice versa. This was done in the attempt to clearly signal that these classes can be used to pass any kind of messages from the controller to the view -- where as errors being only one kind of message.The difference between saveErrors(...) and saveMessages(...) is simply the attribute name under which the ActionMessages object is stored, providing two convenient default locations for storing controller messages for use by the view. If you look more closely at the html:errors and html:messages tags, you can actually use them to get an ActionMessages object from any arbitrary attribute name in any scope.


Q.What are the various Struts tag libraries?

The Struts distribution includes four tag libraries for the JSP framework (in struts-config.xml) :* Bean tag library [ struts-bean.tld ] : Contains tags for accessing JavaBeans and their properties. Developers can also define new beans and set properties* HTML tag library [ struts-html.tld ] : Contains tags to output standard HTML, including forms, textfields, checkboxes, radio buttons* Logic tag library [ struts-logic.tld ] : Contains tags for generating conditional output, iteration capabilities and flow management* Tiles or Template tag library [ struts-tiles.tld / struts-template.tld ] : For tiles implementation* Nested tag library [ struts-nested.tld ] : allows the use of nested beans.

The libraries are designed to:* Facilitate the separation of presentation and business logic.* Dynamically generate Web pages.* Implement the flow of control to and from the ActionServlet.


Q.What is the difference between Struts 1.0 and Struts 1.1?

The new features added to Struts 1.1 are 1. RequestProcessor class 2. Method perform() replaced by execute() in Struts base Action Class 3. Changes to web.xml and struts-config.xml4.Declarative exception handling5.Dynamic ActionForms6.Plug-ins7.Multiple Application Modules8.Nested Tags9.The Struts Validator10.Change to the ORO package11.Change to Commons logging12.Removal of Admin actions13. Deprecation of the GenericDataSource.


Q.What are the core classes of struts?

The core classes of struts are ActionForm, Action, ActionMapping, ActionForward etc.



0 comments: