Which of the following tag is a valid form submission in Struts framework? [ some-action.do is a sample]

Options
- < html:page-form action="/some-action.do">
- < jsp:webform action="/some-action.do">
- < html:web-form action="/some-action.do">
- < html:form action="/some-action.do">


CORRECT ANSWER : < html:form action="/some-action.do">

Discussion Board
html:form action=""

There are Struts-specific Form tag like >html:form /< used to submit in Struts Framework. Form tags define some of the attributes which are as follows:
1) action : Represents the URL to which this form will be submitted. This attribute is also used to find the appropriate ActionMapping in the Struts configuration file. The value used in our example is Name, which will map to an ActionMapping with a path attribute equal to Name.

2) name :Identifies the key that the ActionForm will be referenced by. We use the value NameForm. An ActionForm is an object that is used by Struts to represent the form data as a JavaBean. It is used to pass form data between View and Controller components.
3) type :Names the fully qualified class name of the form bean to use in this request. Example: use of the value example.NameForm, which is an ActionForm object containing data members matching the inputs of this form.

Rohit Sharma 10-15-2014 04:05 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement