83. What are the differences between SAX and DOM parser.

SAX DOM
Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation.
Parses node by node Stores the entire XML document into memory before processing
Doesn’t store the XML in memory Occupies more memory
We cant insert or delete a node We can insert or delete nodes
Top to bottom traversing Traverse in any direction.
SAX is an event based parser DOM is a tree model parser
SAX is a Simple API for XML Document Object Model (DOM) API
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
 
doesn’t preserve comments preserves comments
SAX generally runs a little faster than DOM SAX generally runs a little faster than DOM
If we need to find a node and doesn’t need to insert or delete we can go with SAX itself otherwise DOM provided we have more memory.

82. Describe the differences between XML and HTML

XML HTML

User definable tags

Defined set of tags designed for web display

Content driven

Format driven

End tags required for well formed documents

End tags not required

Quotes required around attributes values

Quotes not required

Slash required in empty tags

Slash not required

81. How you will make available any message resources definations file to the struts famework environment.

Message Resources Definitions file are simple .properties files and these files contains the messages that can be used in the struts project. Message Resources Definitions files can be added to the struts-config.xml file through <message-resources /> tag.
Example:
<message-resources parameter=”MessageResources” />

80. What is Jakarta Struts FrameWork

Jakarta Struts is open source implementation of MVC (Model-View-Controller) pattern for the development of web based applications. Jakarta Struts is robust architecture and can be used for the development of application of any size. Struts framework makes it much easier to design scalable, reliable Web applications with Java.

79. What are the core classes of the Struts Frame Work

Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.

78. What are the components of Struts

Struts is based on the MVC design pattern. Struts components can be categories into Model, View and Controller.

Model: Components like business logic / business processes and data are the part of Model.

View: JSP, HTML etc. are part of View

Controller: Action Servlet of Struts is part of Controller components which works as front controller to handle all the requests.

77. What are differences between <bean:message> and <bean:write>

<bean:message>: This tag is used to output locale-specific text (from the properties files) from a MessageResources bundle. 

<bean:message key=”label.search.name”/>

<bean:write>: This tag is used to output property values from a bean. <bean:write> is a commonly used tag which enables the programmers to easily present the data.

<bean:write name=”student” property=”age”/>