Can I have an Action without a form?
When the /editRegistration action is invoked, a registrationForm is created and added to the request, but its validate method is not called. The default value of the validate attribute is true , so if you do not want an action to trigger form validation, you need to remember to add this attribute and set it to false .
Hi friends,Yes. If your Action does not need any data and it does not need to make any data available to the view or controller component that it forwards to, it doesn't need a form. A good example of an Action with no ActionForm is the LogoffAction in the Struts MailReader application:
<action path="/logoff" type="org.apache.struts.webapp.example.LogoffAction"> <forward name="success" path="/index.jsp"/> </action>
This action needs no data other than the user's session, which it can get from the Request , and it doesn't need to prepare any view elements for display, so it does not need a form.
However, you cannot use the
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.