This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

code help!!

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a jsp page which gets the user name and pass word , fine this works but what i need is that when the user name and pass word is false the page should not proceed further i mean the same login page should appear!!! how can i do this .help me.
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do a check at the login page. First get the username and password by request.getParameter("username") and ("password"), if this two objects are null(String usually), then present the login prompt for user to fill in the username and password. If username and password are not null, check if they are correct. If correct, you can forward the page using <jsp:forward page="your.html">, if incorrect, present login page again. Hope this help.
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if the login is incorrect can i again use the jsp forward tag to display the same jsp page??? seems this does not work!!!
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These come right on top of my head.
**********************************
<%
username=request.getParameter("username");
password=request.getParameter("passowrd");
if (username==null | | password==null){
%>
<jsp:include file="login.html"/>
<%
}
else {
//do your verification here, return can be any, i prefer boolean
// boolean b=verificationMethod(username,password);
if (b){
//password match.
%>
<jsp:forward page="pageforrightuser.html"/>
<%
}
else {
%>
<jsp:include file="login.html"/>
//you may use <jsp:forward page="thispage.jsp/>, but you need some modification,not very sure, may try.
<%
}
}
%>
************************************************************
In your login.html, form action should point to this jsp page.Plese double check the syntax, i write it out on a fly. May contain some mistakes, but i think it should help you to understand logic behind the operation. Hope it helps.
[This message has been edited by SoonAnn Lim (edited August 09, 2001).]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic