Problem in my code



Share on Google+Share on Google+

Problem in my code
1 Answer(s)      8 years ago
Posted in : Development process
View Answers

May 23, 2009 at 1:16 PM

Hi Friend,

It seems that the jsp file you are executing or you are calling is not saved with that name.
Any ways, follow these steps to login:

1) Create login.jsp:

<%@ page language ="java" import="java.sql.*" %>
<body bgcolor="#666666#">
<form name="f1" method="post" >
<table align="center">
<td>User Name</td><td><input type="text" name="t1" ></td>
<td><input type="password" name="t2"></td>
<td><input type="submit" name="b1" value="LogIn"></td>
String user=request.getParameter("t1");
String pass=request.getParameter("t2");
Connection con=DriverManager.getConnection("jdbc:odbc:access");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select username,password from user");
String username=rs.getString(1);
String password=rs.getString(2);
if(user.equals(username) && pass.equals(password))
<jsp:forward page="loginSuccess.jsp" />
out.println("Login Failed,Please try Again");

}catch(Exception e1)

2) create loginSuccess.jsp and print the mesage You have successfully login.



Related Tutorials/Questions & Answers:
Problem in my code - Development process
Problem in my code  Plz go thru this code. I want to check login and pwd with database. Backend MsAccess , Table name : Reg , Dsn Name: JJ While executing code am getting 404 error User Name Password
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
I have problem in my Project
I have problem in my Project  Dear Sir, i have problem in my project about Jtable i have EDIT JButton whenevery i... any sir give me this code
My Eclipse deployed problem. - Struts
My Eclipse deployed problem.  Dear All, I am facing a problem. When First time I am deploying a web project in eclipse in jboss its fine but, when I am changing the project name by pressing 'f2' and then deploying
Please Help To Solve My Problem
Please Help To Solve My Problem  PHP I Have 6 Textbox and 1 ok button. 6 Textbox to Add the 6 Team Name. Each Team Name In String(Like- A,B,C,D,E,F... This Problem With If...Else If...Else Statement But When the More Team
Solve my code
Solve my code  import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import*; public class ChangeDetails extends... is the mistake in this code! This is working only one record doesn't work
code problem - Java Beginners
code problem  Dear sir, my problem is that I've a string value if this String value has "quit" then output should be "bye". i want to make this program using SWITCH CASE statement. how to implement String value in Switch plz
code problem - Java Beginners
code problem  Dear sir, my question was actually how to find... be like: Line1= hy Line3= regard, Line2= how r u? Line4= john! My meant... your problem in details. Which keyword search the line. Thanks
code problem - Java Beginners
code problem  Dear sir, My problem is that i have some string value and in some case i want to remove all the value of this string, i tried this code- Response.str.clear(); but it shows some error called "response package
Pls review my code - Struts
Pls review my code  Hello friends, this is my code in struts action class this page contains checkboxes and radiobuttons also. when i enter the submit it shows me blank page. can anybody solve my problem its urgent. help me
code problem - Java Beginners
code problem  Dear sir, my problem is given below: suppose a file Carries the following lines- Name: john age: 45 Address: goa phone...; Hi friend, Code to help in solving the problem : import
code problem - Java Beginners
is = "80" plz help me i tried my best but i could not make out this type of program. thnx  Hi friend, Code to help in solving the problem...code problem  Dear sir, I've some integer value in ArrayList like
this is my code java - Date Calendar
this is my code java  /* * * * Created on 11...; jTextField1.setText(months); #### This My problem jTextField2.setText(days); #### This My problem jTextField3.setText(years); #### This My problem how
code problem - Java Beginners
code problem  Dear sir, my problem is that, i have two Combobox one.... plz tell how to code this program.   Hi Friend, You can use the following code: ComboBox var arr = new Array(); arr[0] = new
code problem - Java Beginners
code problem  My code is below: import*; class FileRead...()); } } } Dear sir, my problem is that suppose i enter line number: 3 if line... your code and then again try it : import*; class FileRead
code problem:ajax - Ajax
code problem:ajax  Hi,I am using ajax to populate a select box.for this I am writing out.write("ONE"); like runs fine in not in IE.Can anyone help me out this... thanks
code problem - Struts
code problem  hi friends i have 1 doubt regarding how to write the code of opensheet in action class i have done it as the action class code...(); System.out.println(conn); //Code to generate new sheet i.e login time IS NULL
Application context problem code
Application context problem code   now i am posting my code here . i..."); // code to set test action environment createAction("/create", "Test", "list"); // code to execute test action String result = proxy.execute(); // code
Hibernate code problem - Hibernate
Hibernate code problem  Hi, This is Birendra Pradhan.I want... in the DAO.Can it be possibe. Please send some sample code.. thanks & Regards Birendra  Hi friend, For solving the problem visit
pls review my code - Struts
pls review my code  Hello friends, This is the code in struts. when i click on the submit button. It is showing the blank page. Pls respond soon its urgent. Thanks in advance. public class LOGINAction extends Action
code problem - Java Beginners
code problem  Dear sir, I'm havin a problem that suppose i've got... java script j2ee j2me sql plz help me to sort out this problem. thnx   Hi Friend, Please try the following sample code to solve your problem
problem with code - Ajax
problem with code  hi friends i am sending a code in that when we... to use ajax i wrote the code of jsp and the remaning code by using ajax is not wrritened by observing these below code please try the remainning ajax code its
Hibernate code problem - Hibernate
problem please send me code. Visit for more information. http...Hibernate code problem  Hi This is Raju.I tried the first example........How can i solve this problem. Am i need to Kept any other jars in path. 
Problem with code - Java Beginners
Problem with code  Hi Deepak. Im a newbie here at your forum. I have got a simple code of mine which is having a little problem. When I compile it, i get an...,identifier expected'...error. Could you help me out? Thank you
hibernate code problem - Hibernate
/selectclause.shtml If you have any problem this send me detail and source code...hibernate code problem  suppose i want to fetch a row from the table through a value which i got from the jsp page. how can i do it and iterate
pls review my code - Struts
pls review my code  When i click on the submit page i am getting a blank page Pls help me. thanks in advance. public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request
Hibernate code problem - Hibernate
. Please find my src code here... ----------------controller Layer... Hibernate code problem  Hai, iam working on simple login application...(HQL_GET_USERS); }} -------------------------here is my DVO(bean
Code Problem - Struts
Code Problem  Sir, am using struts for my application.i want to uses session variable value in action class to send that values as parameter to function.ex.when i login into page,i will welcome with corresponding user homepage
code problem - Java Beginners
code problem  Dear sir, I have an excel file in D: drive called today.xls, i want to open it thru java program, what code would be compatible plz help me  Hi friend, Code to help in solving the problem : import
problem:struts code - Struts
problem:struts code  Hi, Am using struts1.2.I wrote a form(dynavalidator form)with validation after completing the form if we press submit its call the action class,in action class i gave forward to same form,the problem is if i


Advertisement null