This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See servlet only using out.println() method. but as my web page or the home page is well defined using CSS so how can i check the login information and redirect the user to his home page as I have different home pages for different users. Or can I place any page which will show the Redirecting Please Wait... this message and then redirect to the appropriate page.
please help..!! Many Thanks for any help in advance..!!!
I am not able to understand that in a book i read the home page was displayed in servlet only using out.println() method.
perhaps you are reading any old book.
putting html into servlet is bad way to go use jsp instead.
but as my web page or the home page is well defined using CSS so how can i check the login information and redirect the user to his home page as I have different home pages for different users.
take you username and password values in requestParameter in servlet and check check for username and password.
you can use sendRedirect or to redirect to userarea page and display user information correspond to the username and password.
Well i'm reading that JDBC, Servlets and JSPs Black Book by Santosh Kumar its a 2010 edition. and in that it is given that he has added the html display using out.println() method. for example out.println("<h1>Hello</h1>"); this line will print Hello in h1 size. Do i need to change my book?
Ok. But I'm sorry am still confused. What need to be done now? and If I want a code that once the user is logged in then until he clicks on logout a session should not be over and it should pop up saying Do You want to resubmit the query Please help me am completely stuck and this is the last phase of my project.
posted 5 years ago
Ok. But I'm sorry am still confused. What need to be done now?
What yo have done up to now?
when you checked for login, set the user id to session, and in userarea page you can check that weather session is exist or not, if session is there don't ask for login again.
and for logout, you can just invalidate the session.
Well the designing part is over and now i'll begin with the login thing. In that what i want to check if the user is of first year then he should be redirected to FYBCA home page automatically. How can I do that?