473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

JSP what will happen if i click submit button twice

Hi All
I have an interview question
What will happen if i click the submit button twice in a JSP. Will the second request be processed or not.

Thanks
new learner
Sep 21 '09 #1
3 5474
Frinavale
9,735 Expert Mod 8TB
Of course it will be.
If you hit a button twice then you hit a button twice. Unless you have some sort of JavaScript code (that runs in the browser) to prevent the user from submitting twice it will submit twice. The server could also check to see if the page has been submitted twice but by that point the page is already submitted.
Sep 21 '09 #2
thanks Frinavale
if i am not wrong... it would get submitted twice,but since the object is already found in the session another instance is not created.so there is no response to the second click.

please clarify
Sep 21 '09 #3
Frinavale
9,735 Expert Mod 8TB
Session exists on the server.

It's a type of "container" that is used to store variables that need to be remembered between page submits to the server...and need to be remembered between several different pages.

Session doesn't really play a part in the page being submitted to the server. It plays a part in what is returned to the browser though because usually the variables in Session are used for logical decisions that determine your page's output.

So, if you click a submit button twice, the page is submitted to the server twice.

Session, is just a container of variables that you can access in your server code.

After the page is submitted the Java server-side code is executed. Session is available to the Java server-side code and it can be used to determine what should be sent back to the user.

Session kind of works as a key-value list of stuff. The key can only exist once and the value for that key can be over written whenever you need it to be.

So if your page submits to the server, and then your Java code sets a variable in Session, that variable will be available the second time the page is submitted.

That means that whatever happens to your Session variable depends on your server-side logic....Does the Session variable get set every time the page is submitted? Does the Session variable only get set if it hasn't already been set? Is the Session variable used to determine whether or not the user is allowed to view the content?

The important thing to note is that the action of page being submitted is completely separate from Session...the only thing that connects the two is that the page submit submits a request to the server which executes your Java server-code and your server-code may or may not use Session to make decisions on what should be returned to your user.

You really should research the topic of Session.

-Frinny
Sep 21 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
1
by: rmgalante | last post by:
I have written an ASP.Net application that uses the standard client-side and server-side validation for various fields on the form. Some of the customers that use the form report symptoms that...
16
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
7
by: Bjorn Sagbakken | last post by:
Hello. There maybe an simple answer to this, but sometimes one get a strange blindness when working intensely on one single problem. I'm using ASP.NET 2003, building pages that include 3 user...
2
by: technoGirl | last post by:
Hey guys, I'm doing something similar to the example below (c# version): ...
14
by: Ed Jay | last post by:
Despite searching the net, I can't find a suitable solution that prevents a user's double click from submitting a form twice. I'm currently using the following in a button element: <input...
8
by: thatcollegeguy | last post by:
http://smarterfootball.com/exits/theHTML.html I am not sure what is wrong w/ this code. The main issue is that the table that is in the initial html will empty its td but the table that I load...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.