Posted By:
Brian_Glodde
Posted On:
Thursday, April 10, 2003 09:24 AM
Conceptually:
1.) Create your form with login/password fields.
...
...
2.) Set that form to post to a servlet or jsp that will try to select the record that belongs to that user:
String usr = request.getParameter( "username" );
if( usr == null ) usr = "";
String pwd = request.getParameter( "pwd" );
if( pwd == null ) pwd = "";
if( !pwd.equals( "" ) && !usr.equals( "" ) )
{
// now you can safely query the database to
// retrieve the users unique identifier
}
3.) If you have successfully grabbed the users unique identifier (assuming ROWID), then you can redirect to a personal information page, which will be populated by the unique identifier.
String redirectURL = "http://hostname.com/userinfo.jsp?id=" + userid_from_db;
response.sendRedirect(redirectURL);
4.) Finally, on the personal information page, you'll catch the incoming "id" from the request:
String uid = request.getParameter( "id" );
if( uid == null ) uid = "";
if( !uid.equals( "" ) )
{
// now go to the db and select all the attributes
// you'd like to display, using the "uid" variable
// as the key
}
Hope that helps