Hi,I have a login page which accepts user id and password.On successful entry user navigates to next page.I wish to display a welcome message with user name like "welcome xyz!"..how can i get user name from user id and password (entered in the login jsp file) be displayed in next(successful-login )jsp file that has the welcome msg?...I am using javabeans for db connection and other business logic.

Page1------------
enter user id and password

Page2------------
display a welcome msg with user name

Recommended Answers

All 5 Replies

What have you written so far, what is your problem and how good are you concerning HTML, jsp pages and DB queries

add the username as an attribute to the request (or to the session) after you've pressed the button on the first page, and retreive it in the next .jsp file

something like :
request.setAttribute("name",form.name);

Hello, <%request.getAttribute("name");%>

But im not takin name from the user..only user id and password.with this info i wish to display user name in the nxt page..

When you login using userId and password, take from the db the name and pass it to the next page

use a sql instruction with the correct where clausule

"select name from userTable where user_id like " + request.getAttribute("user_id");

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.