Difference Between Traditional HTML Tags & Struts Supplied HTML Tags

What is the difference between traditional html tags & Struts supplied html tags?

Traditional html tags Struts Supplied HTML Tags
  1.  Given by W3C organization
  2. Use complexity to wards implementing MVC2 princeples
  3. Default request method of form page of form is “GET”
  4.   While working with Struts application Extension word in the action url cannot be generated dynamically.
  5. Application while working with both java & non-java server side technologies.
  1.  Given by apache foundation
  2. Gives support to implement MVC2 Principles
  3. Default request method of form page is “POST”.
  4. While working with action url extension will be generated dynamically in Struts Application.
  5. Application only in Struts application.

With request to 3rd difference

<form action = “reg.do” method = “GET”>

———–

</form>

<form action = “reg.do” method = “GET”>

———–

</form>

Two forms of execute (-,-,-) method:

Form1     public ActionFormward execute (ActionMapping mapping. ActionForm form, Http Servlet Request req, HttpServletResponce res) throws Exception

Form2     public ActionForward execute (ActionMapping, ActionForm form, ServletRequest req, ServletResponce res) throws Exception

  • These two methods are available in predefined org.apache.Struts.action.Action calss.
  • While developing our methods (form1 recommended) to keep business logic & to process the request.
  • The “mapping” object represents <Action-mapping> to Struts configuration file using this object we can know current request related details about current Action class being from the source code of current action class.
  • This object is also useful to generated action forward object representing result page of action class. This object can also be used to make current Action class comm. With another Action class.
  • The “form” represents Form bean class object i.e associated with current Struts action class. Programmer uses this object to read form data of form page & use the data as input values of business logic.
  • This “req” object is useful for the programmer to gather additional details from request given by client. (browser window) like header values, misllaneous details & etc. this object is also useful to create request attributes while passing data from Action class to result page or Action class to another Action class.
  • “res” object is useful to set response header values in the process of sending Action class generated result directly to browser window. Like setting content type specifying auto-refresh mode, setting content and etc.

Leave a Reply

Your email address will not be published. Required fields are marked *