GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Struts
Go To First  |  Previous Question  |  Next Question 
 Struts  |  Question 91 of 102    Print  
Explain saveToken() function

  
Total Answers and Comments: 1 Last Update: November 26, 2007     Asked by: selva 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: DEBABRAT
 
saveToken() method is used for duplicate form submission.
Let's take an example i.e. yahoo email registration form

You filled the form and press the "submit" button more than once.
For each action you do there is a request object associted with that.
So when you press the submit button twice that means you are sending
the same request twice so it will update the database twice which is an
overhead.

To check this struts have saveToken() along with isTokenValid()

Above answer was rated as good by the following members:
pradeepkmr18
November 24, 2007 10:00:01   #1  
DEBABRAT        

RE: Explain saveToken() function
saveToken() method is used for duplicate form submission.
Let's take an example i.e. yahoo email registration form

You filled the form and press the "submit" button more than once.
For each action you do there is a request object associted with that.
So when you press the submit button twice that means you are sending
the same request twice so it will update the database twice which is an
overhead.

To check this struts have saveToken() along with isTokenValid()

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Latest Answer : When we deploy our application in the server, at first the container reads the information from web.xml file.Here ActionServlet object will be created and init() of ActionServlet will be called.Here ActionServlet is the backbone to the whole application.When ...

Latest Answer : These are the tags we can define ,,,,,  ...

Latest Answer : Tokens are used to prevent multi click problem in struts. In Action class method at the begining of the code, need to call the saveToken() that generates an unique identifier for the "request url" and stotes it in the session and also in the ...

need answer 
Latest Answer : Struts implements MVC design so that we can divide the web application in to view, data access/modify and controller layers.  JSPs and HTMLs are come into view, when a user enters data into form and submits a request, it goes to Action servlet, in which ...
Read Answers (4) | Asked by : saraswati

Latest Answer : Hi to allAs Madhav specified  (Struts follows MVC architecture and has many design patterns which it uses inside(ex Frontcontroller,Value Objects). )what are the other design patterns which it uses inside and can it be brief ...

Question: Assuming the class LoginForm contains a String property named "password", how does the LoginAction class access the attribute called "password" in the above request? Explain why.Choice 1 String password = request.getParameter("password"); Choice 2 String password = request.getAttribute("password"); Choice 3 request.getParameterNames().getParameter("password"); Choice 4 String password = ((LoginForm)
Read Answers (5) | Asked by : N

Latest Answer : Hi, If the client comes to the struts application then the flow of control will be.. 1) The request received by hte ActionServlet which is the default Controller in Struts... 2)ActionServlet then call RequestProcesser.preProcess method to ...
Read Answers (5) | Asked by : kalpana

Latest Answer : saveToken() method is used for duplicate form submission.Let's take an example i.e. yahoo email registration formYou filled the form and press the "submit" button more than once.For each action you do there is a request object associted with that.So when ...
Read Answers (1) | Asked by : selva


 Sponsored Links

 
Related Articles

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Function Passing Types

C Function Passing Types In this C tutorial you will learn about function passing types two types of arguments passing in functions passed by value  and  passed by reference are discussed here mosgoogle center The arguments passed to a function can be performed in two ways Passed
 

What is DECODE function used for?

DECODE is used to decode a CHAR or VARCHAR2 or NUMBER into any of several different character strings or numbers based on value. That is DECODE does a value-by-value substitution. For every value that is given in the DECODE function it makes an if then check and matches the value. The general format
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf("%d",printf("%d %d %d", a,a,a)); } In this above program the inner printf i
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What is the default return value of a function?

The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.   When a programmer wants other than integer values to be returned from function then it is essential that the pro
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape