Action without a form.

Ads

 
 

Share on Google+Share on Google+

Clark
Action without a form.
1 Answer(s)      6 years and 6 months ago
Posted in : Struts

Can I have an Action without a form?

Ads
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
Calling Action on form load - Struts
Calling Action on form load  Hi all, is it possible to call... not want an action to trigger form validation, you need to remember to add... component that it forwards to, it doesn't need a form. A good example of an Action
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 can we submit a form without a submit button?
How can we submit a form without a submit button?  How can we submit a form without a submit button
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
how to point my jsp form action to servlet? - JSP-Servlet
how to point my jsp form action to servlet?  I am currently using netbean 6.8, tomcat 6.0, and mysql database. I was having problem when I was trying to point my jsp action to my servlet.(f.action="../fyp.servletLogin";) fyp
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
without ;
without ;  can u give me an example of a program without
without ;
without ;  can u give me an example of a program without
JSTL: Form Action Text Field
JSTL: Form Action Text Field     ...;head> </head> <body> <form method="post" action... to retrieve the value we have entered in the jsp form.  Firstly we are going
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
no action mapped for action - Struts
no action mapped for action  Hi, I am new to struts. I followed...: There is no Action mapped for action name HelloWorld
PHP Form Part-2
Topic : HTML FORM Action Attribute Part - 2 If you noticed, in the previous... attributes. Let's understand these attributes separately : <form action="... action tells that " where do you want the form sent?". If you
form
form   Can I prevent a form from being submitted again
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
Action Listeners
Action Listeners  Please, could someone help me with how to use action listeners I am creating a gui with four buttons. I will like to know how to apply the action listener to these four buttons.   Hello Friend, Try
Action tag - JSP-Servlet
Action tag  Hello, I want to help ....i hav one feedback form there is action , .. can i use two action at the same form because i want html page on submitting feedback form and instead of above tag i change form
without scanner
without scanner  a company need a system to store the data about the employees , the number of employees is dynamic , you need to store the following attributes : name , age , salary and note that we need to solve it using array
DTO & Action class - Struts
DTO & Action class  Hi I am really new to struts2. I just wanted to know that if I have a DTO and an action class, how do I put the form data into the DTO? Can someone please explain with a simple example
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
servlet action not available - Struts
servlet action not available  hi i am new to struts and i am getting the error "servlet action not available".why it is displaying this error. Struts Blank Application action org.apache.struts.action.ActionServlet
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
Struts Action Chaining
Struts Action Chaining  Struts Action Chaining
PHP HTML Form Submit Button
of the tutorial then our Html form has covered the action and method attribute... in Html is used to submit form data to the page mentioned in the ACTION attribute. Let's see the example below: <form action="basic_form.php" method
submit a form
submit a form  How can we submit a form without a submit button
Tutorials   
Java Spring Hibernate Struts Training Dynamic tabs in struts 1.2 Unable to upload a file to mysql database using struts1 Pagination in struts 2 struts2 filterdispatcher is deprecated please use the new filters viewing How to add struts2 dependency in Maven? Struts Exception Handling can you check below code if any erors multimedia how to display the value of termcell name in label class not found exception Where to learn Struts 2? dropdown cacheing Upload and Download Large files in jsp What is Struts 2 framework struts and hibernate based health care project source code struts and hibernate based health care project source code Struts 2 Integration with Struts 1 About captcha of strut2 About captcha of strut2 Which is the good website for struts 2 tutorials? advance java source code source code In Struts 2 how to pass the Struts struts internationalization for Korean language struts2 Struts2 and Hibernate Fetch Data Base Value Struts2 and Hibernate Fetch Data Base Value Struts2 and Hibernate i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse Struts2 and Hibernate Struts2 and Hibernate Struts2 validation Procedure Struts2 validation Procedure Struts2 validation Procedure Struts2 validation Procedure Struts 2 action-validation.xml not loading Struts-2 and Ajax integration STRUTS QUESTION conerting web project into .exe file About Select tag ScartApplication aplicacion ecommerce struts 1.3 struts 1.3 sms prob Need to know struts1 all jar file names struts with hibernate

Ads

 
Advertisement null

Ads