how to disable submit button after login in jsp

Ads
 

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

Ads









Related Tutorials/Questions & Answers:
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
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
Advertisements
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
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
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 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 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
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 a submit button when user click on the submit button after filling username
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 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
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 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" /> <
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
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 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
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
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
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
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
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
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
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
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
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><
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

Ads