Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: something on login page


Message #1 by Super Powerfulrez <powerfulrez@g...> on Mon, 26 Feb 2001 10:35:14 -0800 (PST)
Hi
First of all u should have an login page desined alreday or u can design it
by but a tow text field in it
then in html file u will see FORM tag , in FORM tag and exactly in Action
property write this statement for example

<form method="POST" action="Login.jsp">

where Login.jsp is the file u  write ur code in it to specify that is the
user name and password is correct or not
and this is some code to see it.

<BODY>
<jsp:useBean id="Process" class ="Card_ST.Process"  scope="request">


<%
        String userName = request.getParameter("username");   // and be care
the username is the name of text field in first page
       String password = request.getParameter("Pass");		// and also here
pass is the name for the second text field

        boolean flag;

       flag = Process.verifyUser(userName,password);			// there are method
in Process.java file called
        if (! flag) {
       %>
        <jsp:forward  page="Error.jsp" />		//  so if the method return false
so username and password is wrong and this statement forward the user to any
error page
<% }

else
 %>
<jsp:forward  page="Card.jsp" />				// this is if method return true ,
forward user to any page u want also
</jsp:useBean>


</BODY>


any Q u can ask again

good luck
Mohammad Jamous

-----Original Message-----
From: pro_jsp@p... [mailto:pro_jsp@p...]
Sent: Monday, February 26, 2001 6:35 PM
To: pro_jsp@p...
Subject: [pro_jsp] something on login page


1. can any 1 show me / give me the syntax to do a login page with password?
where is the login name and password stored? in the sql database?

2. and how do i stop ppl from accessing a specified page if they did not log
in... please help... due date coming and i don't know how to do it, i have
checked alot of books but i don't understand most of it... all i know is
that i
have to utilise jsp bean and servlet...

3.and how do i stop concurency problem from happening? any example of the
syntax?

4. in the place where i define the bean... what is class?
<jsp:useBean id="something" class="hall.SimpleBean" />
is it a class file? a .java file? i have no idea what is it... please
explain...

your kindness is highly appriciated...

benjamin

___________________________________________________
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com






  Return to Index