how to disable submit button after login in jsp

how to disable submit button after login in jsp

Hi,

I have an application and when user logs in welcome page is displayed. When user clicks on the back button in browser it stars displaying login page. How to prevent this?

how to disable submit button after login in jsp?

Thanks

View Answers

October 9, 2018 at 12:28 PM

Hi,

You can use the http session variable in the login.jsp page. When use logs in create a session variable and set its value to yes as shown below:

session.setAttribute("loggedin", "yes");

Now in login page you can get the value of this session in the login page:

String s = session.getAttribute("loggedin");
if(s!=null){
   //Then display login page
}else{
  //Then display welcome page
}

This way you can achieve it.

Check more tutorials:

These tutorial will help you in learning JSP Login and session management.

Thanks









Related Tutorials/Questions & Answers:
how to disable submit button after login in jsp
how to disable submit button after login in jsp  Hi, I have... on the back button in browser it stars displaying login page. How to prevent this? how to disable submit button after login in jsp? Thanks   Hi, You can
How to disable browser back and forward button after logout [in struts2 or jsp]
How to disable browser back and forward button after logout [in struts2 or jsp]  How to disable browser back and forward button after logout [in struts2 or jsp] I am using window.history.forward(); function
Advertisements
how to disable back button of a browser after logging in? - JSP-Servlet
how to disable back button of a browser after logging in?  how to disable back button of a browser after logging in?  where is the source code
how to disable submit button in jsp using servlet when some condition is satisfied
how to disable submit button in jsp using servlet when some condition is satisfied  how to disable submit button in jsp using servlet when some condition is satisfied
How to disable browser back after logout - JSP-Servlet
How to disable browser back after logout  Dear All I created JSP page for logout and redirecting in login page. when i am clicking logout session.... Anyone having idea how to disable browser back button after logout, please
JSP Submit Button
JSP Submit Button  Sir, I have a JSP page with 2 Submit button, both calls doPost method of same servlet. If I click any submit button the text box value get refreshed and set to null or blank, that should not happen. Plz help
How to disable browser back after logout - JSP-Servlet
How to disable browser back after logout  thanks deepak, i tried but if i am clicking back still i can see my old pages. i copied your code in my logout page. please if you have any other solution, please give me
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
How to Display Username After Login in JSP
How to Display Username After Login in JSP In this section we will discuss how to display the Username and password after the successful login. In JSP... and password and a submit button when user click on the submit button after
after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp
after entering details in reg page,n enter the submit button,how can v store... registration page n login page. after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm
how to disable browser back button
how to disable browser back button  Am doing a web application in that how to disable browser back button using java script
disable and enable the submit buttons
disable and enable the submit buttons  i have two summit button in my form. one is disabled and other is navigating to the other page. after 3 submissions of the submit button the disabled one must be enabled and the enabled one
How to prevent from navigating to a page after reaching Login page using back button?
How to prevent from navigating to a page after reaching Login page using back button?  Hi sir, I have created 2 pages, 1) Lo gin Page 2)Page... login page using back button and agin click browser forward button,the 2nd page
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
To Retain the values entered in the text box after submit in jsp page
To Retain the values entered in the text box after submit in jsp page   i am working on a jsp pge which has many text boxes and one dynamic drop... after submit has been done ? coz when data is displayed then the values entered
submit button
submit button  <p>hi I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go...; <input type="submit" value="Insert" name="login" /> <
storing details in database on clicking submit button - JSP-Servlet
database on clicking submit button. I am unable to do this.Can u tell me how to code...storing details in database on clicking submit button  I am using JSP...? JSP Page Name
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p
How to disable Browser's back button (at the same time i want my own back button to be enabled) :p  Hi, I have designed a "back" button for jsp page. Now I want to disable Browser's default button So that people will use "back
JSP data after login where different users data are stored in database
JSP data after login where different users data are stored in database ... and then after they can login. my question is how a user can see only his data after login...="submit" value="Login"></td></tr> <tr><td></td><
disable the form - JSP-Servlet
Ajax. after response is coming to the jsp page,particular form button... that particular button disable by using document.formname.buttonname.disable = true...disable the form  Hi All, I'm developing a small application. I
disable back button - Java Beginners
disable back button  I wanted the code for disabling back button... to login using the login pop up window, i get logged in and user name is also displayed but..when i click back button i go back to the register page which should
how to genrate login id and password after submitting the sign up form?
how to genrate login id and password after submitting the sign up form? ... i want 2 knw that after user submit all the details i that sign up form than how he will get their login id nd passwrd automatically
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
Submit comments in database when user clicks on submit button
to show how to submit comments from a jsp page and insert it to the MySql database when user clicks the submit button of the page. Create a database: First... Submit comments in database when user clicks on submit button
Clear the print button after onclicking the print - JSP-Servlet
Clear the print button after onclicking the print  rate_print.document.writeln(" "); hai sir, this is my java script code, i ask how to clear the printbutton image when after onclicking the print button....  Hi
image on submit button
image on submit button  i need to set an image on submit button. In javascript we can create a button like.. <a href="javascript:;" class="button">Sign up</a> But how will i do it from CSS?   The best way
how to enable and disable a input type in jsp - JSP-Servlet
how to enable and disable a input type in jsp  how to disable the input type and enable based on some input in the input type   Hi Friend, Try the following code: function function1(){ var n
Disabling submit button using jQuery
Disabling submit button using jQuery  Hello Sir I want to know - is there any way or approach to disable client side form's "Submit" button. Please give code also.ADS_TO_REPLACE_1   For all submit buttons, via JQuery
How to use filter to redirect to login page after session timeout.
How to use filter to redirect to login page after session timeout.  ... then automatically it should redirect to login page from where user has to login again to access the resources. I know filters are used for this but do
How to use filter to redirect to login page after session timeout.
How to use filter to redirect to login page after session timeout.  ... then automatically it should redirect to login page from where user has to login again to access the resources. I know filters are used for this but do
Retrive only requird data from a table in MYSQL databade to JSP file..on a field submit button.
Retrive only requird data from a table in MYSQL databade to JSP file..on a field submit button.  i have MYSQL DB,DB NAME:TRLIST, TABLE NAME:TR_LIST...;Submit> button===> i.e.,select node,package from tr_list where tr='yyy
How to use filter to redirect to login page after session timeout
How to use filter to redirect to login page after session timeout  hello Sir, I have to make a web application in which i have to give session... then automatically it should redirect to login page from where user has to login again
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  sir am doing project in ASP.NET useful for my college that is placement portal...please help in display details of particular student after he login ...i want
facebook login button html
facebook login button html  facebook login button html i have a facebook login button code ..but not sure how to use it. Can any one please explain? Here is the facebook login button code in html <fb:login-button
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  ... my question is how to retrieve this information of user after registration... the user information.. now their is a login and registration page for newuser
Jsp login with Cookie - JSP-Servlet
Jsp login with Cookie  9) Create an HTML page containing the following features a. Create a login JSP page with username , password and submit button. b. On submit, display message ?Thank you for logging in ? Also create
How to disable back button in browser using javascript
There are times while developing a website, we need to disable back button... that will disable the working of Back button in Browser:ADS_TO_REPLACE_1 <... of the time the back button is disabled because a user can hit back
How to call java method on Button click in jsp?
How to call java method on Button click in jsp?  How to call java method on Button click in jsp
JSP - Login
JSP - Login  how to disabled back button of the browser when user successfully logged
ModuleNotFoundError: No module named 'odoo10-addon-stock-disable-force-availability-button'
-availability-button After the installation of odoo10-addon-stock-disable-force...-availability-button' How to remove the ModuleNotFoundError: No module named 'odoo10-addon-stock-disable-force-availability-button' error? Thanks
ModuleNotFoundError: No module named 'odoo8-addon-mrp-disable-force-availability-button'
After the installation of odoo8-addon-mrp-disable-force-availability-button...-button' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-mrp-disable-force-availability-button' error? Thanks   
ModuleNotFoundError: No module named 'odoo8-addon-mrp-disable-force-availability-button'
After the installation of odoo8-addon-mrp-disable-force-availability-button...-button' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-mrp-disable-force-availability-button' error? Thanks   
ModuleNotFoundError: No module named 'odoo8-addon-stock-disable-force-availability-button'
-button After the installation of odoo8-addon-stock-disable-force-availability...-availability-button' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-stock-disable-force-availability-button' error? Thanks  
ModuleNotFoundError: No module named 'odoo8-addon-stock-disable-force-availability-button'
-button After the installation of odoo8-addon-stock-disable-force-availability...-availability-button' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-stock-disable-force-availability-button' error? Thanks  
ModuleNotFoundError: No module named 'odoo9-addon-mrp-disable-force-availability-button'
After the installation of odoo9-addon-mrp-disable-force-availability-button...-button' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-mrp-disable-force-availability-button' error? Thanks   
ModuleNotFoundError: No module named 'odoo9-addon-stock-disable-force-availability-button'
-button After the installation of odoo9-addon-stock-disable-force-availability...-availability-button' How to remove the ModuleNotFoundError: No module named 'odoo9-addon-stock-disable-force-availability-button' error? Thanks  

Ads