Share on Google+Share on Google+

Deepak Kumar
Calling Action on form load
1 Answer(s)      9 years ago
Posted in : Struts

Hi all, is it possible to call... this list is coming from the action which i m calling before the page is being... to direct user directly to this page i m calling an action which is preparing a list

Ads

View Answers

November 20, 2010 at 4:29 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.










Related Tutorials/Questions & Answers:
Calling Action on form load - Struts
Calling Action on form load  Hi all, is it possible to call... this list is coming from the action which i m calling before the page is being... to direct user directly to this page i m calling an action which is preparing a list
Action form
Action form  how to store details from user and how to create asp file or etc
Advertisements
Form Should not load
box after submitting or the form should not load again. Thanks in adbance...Form Should not load  I have a jsp page which has textbox and dropdown box, when I submit it, the page reloads and the textbox and dropdown box also
Action without a form.
Action without a form.  Can I have an Action without a form
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 load values of html form into an excel table using java servlet?
how to load values of html form into an excel table using java servlet?   i have written a java servlet program, which has a html form to be filled. after filling the form the servlet generates a receipt and the values should
Calling In JavaScript Functions from HTML Form To Validate User Entered Data
Calling In JavaScript Functions from HTML Form To Validate User Entered Data  Hello, I have been working for days on my web Form assignment...;link href="form_style_1.css" rel="stylesheet" title="Subscription Form Style 1
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 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
Sending form data from HTML page to SQLserver 2005 database by calling servlet code
Sending form data from HTML page to SQLserver 2005 database by calling servlet code  Hi sir, I would like to know how to send the form data from html page to database by calling servlet code from html page .   
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
calling java method from html form with out using javascript - JSP-Servlet
calling java method from html form with out using javascript  How can i call java method from a HTML form, java script should be disabled?  ...;script LANGUAGE="JavaScript">function testResults(form
Calling a function
Calling a function  Hi, I have a function xyz() in php code. When a button is clicked it should execute that particular function for that i have written as <form action="<?=$_SERVER['PHP_SELF'];?>" method="post">
Struts 2 Action Tag
Struts 2 Action Tag "action" Tag in Struts 2 is used by developer to call action class from a JSP page. For calling the action class, developer must assign action name. Struts 2 Action Tag is one of the Data Tags, which are used
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
video calling
video calling  how to implement video calling using java? i am a final year mca student please give me some samplecodes
video calling
video calling  how to implement video calling using java? i am a final year mca student please give me some samplecodes
Ajax Load
Ajaxload The ajaxload is a tool, which follow web2.0 standard. Due to slow Internet speed or delay some times data takes time to load. At this time we can incorporate an animated gif image, which indicate user for the loading
Calling Destructor
Calling Destructor  How can i call destructor in java using System.gc() or manually. Please anyone give me a example program   Java is a garbage collected language therefore you cannot predict when (or even
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
Load Icon Image Exception
Load Icon Image Exception  Load Icon Image Exception
how to load pdf on html
how to load pdf on html  how to load pdf on html
Load UIImage from URL
Load UIImage from URL  Load UIImage from URL
Calling a jsp page from Servlet
Calling a jsp page from Servlet  How can I do this? Suppose I have jsp page aaa.jsp. From aaa.jsp on form action I have made a call to a servlet xxx.java. In xxx.java I have written code to retrieve data from database through
nsstring load from file
nsstring load from file  Hi, How to load file data into NSString object? Example of nsstring load from file, basically the html file data into NSSTring object. Thanks
jQuery Ajax load request
jQuery Ajax load request  Hi, How to use jQuery to send the request on server to load data in web page? Thanks   Hi, In the jQuery Load... and then load the data in web page. Thanks
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
UIWebview load url
UIWebview load url  How to load website url in UIWebview? Tell me code for UIWebview load url of a website Thanks...: //Load web view data NSString *strWebsiteUlr = [NSString stringWithFormat:@"http
form
form   Can I prevent a form from being submitted again
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