JSP login

JSP login

Post by Phivo » Wed, 18 Apr 2001 01:16:32



I 'm trying to figure out a way of customer login into a website through
JavaServer Pages. The idea is to confirm their login with a SELECT
statement from an Oracle table, and if the SELECT succeeds, to forward
the clients to a new page (with their usernames and passwords checked
from now on through http session attributes).

The problem is that I haven't been able to "hold back" the whole
procedure of forwarding to a new page, until the SELECT succeds (and of
course if it fails, then redirect to login.jsp)

Or, in other words, make the <jsp:forward .../> *ONLY* if the SELECT
statement in the database succeeds, ELSE redirect to the login.jsp page.

Any ideas?
Thanx in advance for any ideas

--
__
Never explain.
Your friends will understand you.
Your enemies will never believe you anyway.

 
 
 

JSP login

Post by AV » Wed, 18 Apr 2001 10:50:47


You can easily place html and jsp tags between
<% if (rs.next()) { %>
goto welcome page
<% } else { %>
goto login
<% } %>

There is a special tag for this function in struts (jakarta.apache.org).
If you are more comfortable with classical java, than look
at servlets, there are also both forwarding and redirect capabilities
in plain java.

AlexV


Quote:

> I 'm trying to figure out a way of customer login into a website through
> JavaServer Pages. The idea is to confirm their login with a SELECT
> statement from an Oracle table, and if the SELECT succeeds, to forward
> the clients to a new page (with their usernames and passwords checked
> from now on through http session attributes).

> The problem is that I haven't been able to "hold back" the whole
> procedure of forwarding to a new page, until the SELECT succeds (and of
> course if it fails, then redirect to login.jsp)

> Or, in other words, make the <jsp:forward .../> *ONLY* if the SELECT
> statement in the database succeeds, ELSE redirect to the login.jsp page.

> Any ideas?
> Thanx in advance for any ideas

> --
> __
> Never explain.
> Your friends will understand you.
> Your enemies will never believe you anyway.


 
 
 

JSP login

Post by Phivo » Wed, 18 Apr 2001 12:18:22



Y????...

Quote:> You can easily place html and jsp tags between
> <% if (rs.next()) { %>
> goto welcome page
> <% } else { %>
> goto login
> <% } %>

> There is a special tag for this function in struts (jakarta.apache.org).
> If you are more comfortable with classical java, than look
> at servlets, there are also both forwarding and redirect capabilities
> in plain java.

> AlexV

Ok, thanx man , I 'll check that out too.
In the meantime I managed to achive what I was looking for, via "http
session" calls and jsp forwarding, if the getUsername property returned
!= null from the bean.

--
__
Never explain.
Your friends will understand you.
Your enemies will never believe you anyway.

 
 
 

1. JSP Login question

Hi

I am trying to design a web page using jsp/servlets, as part of a university
group project, which will allow several different users to connect to a
database.
Each user has different privileges.

I have no prior knowledge of java servlets.

Can anyone point me in the right direction to implement the logon process. I
want each user to be able to login and be directed to a page determined by
their preset privilege.

Thanks for any help

Richard Szurgot

2. Use query inside access database with ADO client

3. Jsp and Jsp.

4. stored procedure template

5. NT Login Fails Becuase SQL Login Exists

6. Bidirectional Binary Fileds, SQL7???

7. Auto login or login bypass when connecting to a SAP BW cube from Cognos

8. Foreign Key question

9. QA login succeeds, EM login fails?!

10. How check if LOGIN has grant login to server

11. One Login Name vs. Multple Login Names

12. ODBC login uses default database for login

13. ADO login uses windows login id