Action without a form.

Ads
 

Action without a form.

Can I have an Action without a form?

View Answers

November 20, 2010 at 3:41 PM

Hi friends,

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 tag without an ActionForm. Even if you want to use the tag with a simple Action that does not require input, the tag will expect you to use some type of ActionForm, even if it is an empty subclass without any properties.

Thanks.

Ads









Related Tutorials/Questions & Answers:
Action without a form.
Action without a form.  Can I have an Action without a form
Action form
Action form  how to store details from user and how to create asp file or etc
Advertisements
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
form validate and perfom action immediatly
form validate and perfom action immediatly  This is ok, but what i'm looking for is whenever a user input different data his input has to validate..." for Age in a form then he needs to redirect him to some web page like
How to validate a form in action class and forward errors to the jsp in struts?
How to validate a form in action class and forward errors to the jsp in struts?  How to validate a form in action class and forward errors to the jsp in struts
how to display action errors in jsp which is in a form list
how to display action errors in jsp which is in a form list  My jsp contains list of forms iterating using display:table, each FORM forms a row. I want to display action errors for individual form in the same row
How to save form fields into the MySql Database without submit button in jsp?
How to save form fields into the MySql Database without submit button in jsp?  I want to store user inputs into the database using javasccript or ajax or jqury but without submit button. Form Contains three fields
print selected checkbox names in array without form tag
print selected checkbox names in array without form tag  Hi everyone ... I have problem in my program. I have hashmap i.e. collection , my... seleced checked checkbox names, when i click on button but without using FORM tag
without ;
without ;  can u give me an example of a program without
without ;
without ;  can u give me an example of a program without
linking tree heading in javasript into a Jsp file and then jsp to struts action form
linking tree heading in javasript into a Jsp file and then jsp to struts action form  i have a tree that consists of 3 options say for example 1... javascript tree link to struts action class
Action Submit Html
Action Submit Html       Action Submit in Html is used to submit a form, When a user clicks on a submit button, the form is sent to the specific address
struts form
comes to second text box without mouse action).How to do this. Please help me...struts form  Hi, This is Rajesh.I'm creating struts form in jsp.i have two textboxes in my jsp.During Jsp page loading focus will automatically
submit a form
submit a form  How can we submit a form without a submit button
Action and ActionSupport
Action and ActionSupport  Difference between Action and ActionSupport.... The developer implements this interface of accessing string field in action... for implements Action and some other interfaces and provides some feature like data
UISlider action
UISlider action  Hi, How to capture and use UISlider action? Thanks   Hi, Following code might helpful. -(IBAction)changeSlider:(id)sender { NSString *value= [[NSString alloc] initWithFormat:@" Value %d
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
<form id=
form id  sir, <form id="reg1" action="../UploadingCtrl" method="post" enctype="multipart/form-data" name="form1"> this action page can't get String tp = request.getParameter("indegrates"). i wrote article upload
standard action - JSP-Servlet
; hi friend.. Action Allow you to specify components from a tag library or a standard tag. For Example : Action may display an output or write some value to servlet without showing any output. Actually action is a tag name and tag
No action instance for path
; <body bgcolor="white"> <html:form action="/FileUploadAndSave...; </form-beans> <action-mappings> <action path... [email protected] */ /** * Struts File Upload Action Form
Struts Action Class
Struts Action Class  What happens if we do not write execute() in Action class
Jsp Action Tags
Jsp Action Tags  how can i use jsp forward action tag?i want examples
ModuleNotFoundError: No module named 'action'
ModuleNotFoundError: No module named 'action'  Hi, My Python... 'action' How to remove the ModuleNotFoundError: No module named 'action'... to install padas library. You can install action python with following command
JSP Forward action
JSP Forward action  Jsp forward action tag examples
RADIO FROM JSP TO ACTION.
RADIO FROM JSP TO ACTION.  Hi frds, how to get the selected multiple radio button values from jsp to action
Action classes in struts
Action classes in struts  how many type action classes are there in struts   Hi Friend, There are 8 types of Action classes: 1.ForwardAction class 2.DispatchAction class 3.IncludeAction class 4.LookUpDispatchAction
uibarbuttonitem initwithcustomview action
uibarbuttonitem initwithcustomview action  HI, Can anyone provide me the code for uibarbuttonitem initwithcustomview action? In my application I am adding custom BarButtonItem, how I can attach an action to it? Thanks
Double To Int Without TypeCasting
Double To Int Without TypeCasting  How to convert Double to Int without using typecasting?   class ConvertDoubleToInt { public static void main(String[] args) { double d=25.5; int num=new
Form Handling in Spring Framework
the program the program is forwarding to another page according to form action...Form Handling in Spring Framework  I have created spring project.I created the form. When I entered the values to the form, the values should
form validation
form validation  how the form validation is done in jsf form using javaScript
DataGrid without DataBase
DataGrid without DataBase  I want display list of data without using database. Ex- Employee have some elements like- name, sex, place, designation. I have to display the content of these elements but without having

Ads