What is the difference between traditional html tags & Struts supplied html tags?
Traditional html tags | Struts Supplied HTML Tags |
---|---|
|
|
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.