Home Answers Viewqa Development-process Problem in my code

 
 


Rajendra
Problem in my code
1 Answer(s)      4 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.*" %>
<html>
<body bgcolor="#666666#">
<form name="f1" method="post" >
<table align="center">
<tr>
<td>User Name</td><td><input type="text" name="t1" ></td>
</tr>
<td>Password</td>
<td><input type="password" name="t2"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="b1" value="LogIn"></td>
</tr>
</table>
<%
String user=request.getParameter("t1");
String pass=request.getParameter("t2");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:access");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select username,password from user");
if(rs.next()){
String username=rs.getString(1);
String password=rs.getString(2);
if(user.equals(username) && pass.equals(password))
{
%>
<jsp:forward page="loginSuccess.jsp" />
<%}
else
out.println("Login Failed,Please try Again");
%>

<%
}
}catch(Exception e1)
{}
%>
</form>
</body>
</html>

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

Thanks









Related Pages:
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
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
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 java.io.*; 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 java.io.*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
Problem
(); stdIn.close(); echoSocket.close(); } } this is my code, compiled
Problem
(); echoSocket.close(); } } this is my code, compiled with no errors, but when running giving
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
this is my code java - Date Calendar
this is my code java  /* * NewJFrame.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'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 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
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
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
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 java.io.
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 java.io.*; class FileRead...()); } } } Dear sir, my problem is that suppose i enter line number: 3 if line... your code and then again try it : import java.io.*; class FileRead
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...("account.password", "test"); // code to set test action environment createAction("/create", "Test", "list"); // code to execute test action String result
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
hibernate code problem - Hibernate
hibernate code problem  String SQL_QUERY =" from Insurance...: " + insurance. getInsuranceName()); } in the above code,the hibernate where clause was used and then it was iterate to fetch the values. but my
combo box code problem
combo box code problem  in this my problem related to : when i select state MP then i wil open the its corresponding city but in database it only stores the option value no like MP at option value 10 then it will stores the 10
Small Bug How to solve in my code
Small Bug How to solve in my code  String season=""; pst... +=rs.getString("season") + ","; } in above code seasons +=rs.getString("season... the problem
doubt in my program code - Java Beginners
. It would be good for me to provide you the solution if problem is clear. Plz send code...doubt in my program code  i have developed a web browser... the code i developed i can send u to ur mail if u give ur mail id
Hello Sir I Have problem with My Java Project - Java Beginners
Hello Sir I Have problem with My Java Project  Hello Sir I want Ur Mail Id To send U details and Project Source Code, plz Give Me Ur Mail Id
What's wrong with my pagination code in JSP?
What's wrong with my pagination code in JSP?  Dear experts, I've... the above code. I have a problem here. As I'm using MsAccess, I still couldn't figure.... Hope someone can advise me how to. Thanks! print("code sample"); <
please do respond to my problem sooooon sir - Java Beginners
please do respond to my problem sooooon sir  Hello sir, Sir i have executed your code and i got the result but the problem is whenever i click on the link in my browser the link is opened in the internet explorer.i need
Please help me to modify my java code from php code
Please help me to modify my java code from php code  i want to covert this php code int java/JSP . if (isset($_POST['orders'])) { $orders...;   Thank you , But this not my exact solution for my problem. What
Jsp Code Problem - JSP-Servlet
Jsp Code Problem  I use DocType in my Jsp Page. The Links are not functioned after Applying the DocType. Could you tell me any way to activate the link. Thank You.   Hi Friend, Please send your code. Thanks
sir plz do respond to my problem immediately - Java Beginners
sir plz do respond to my problem immediately  Hello sir, Iam very happy that you have responded to my problem.The code u sent... code(sent by you).plz inject that code into my browser code so that it can show
java - code problem - Java Beginners
java - code problem  hi I want to create log file for my new project... this information in my log file.  Hello Try common-logging jar of Apache Group. Other Wise send ur code. Thanks
javascript code problem - JSP-Servlet
javascript code problem  Thanks for sending answer.but actually what u send is not my actual requirement.first look this code. Subject...; "> in above code which is jsp and struts form bean
Problem with Link To website with my Java Appliaction - Java Beginners
Problem with Link To website with my Java Appliaction  Hello Sir... Source Code,I have Completed Follownig Code,plz add Visit US Button Code...(); } }   Hi Friend, We have modified your code. import
java Code Problem - Java Beginners
java Code Problem  Hi Sir. i am creating one java program in which i want to remove unsed variables from java program and store it into another name or same name.for example,my program is as follows. class Prog1 { int
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync Data Sync Data Please use the following input box to upload file or enter... showing null value and i downloaded this code from net but this also not showing
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync Data Sync Data Please use the following input box to upload file or enter the user id in input box directly. Upload File: Enter UserId
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
problem in onlinetest...
problem in onlinetest...  hi, my code getting the problem is ,when user leave a question then the server puts error... pls help me
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 java.io.*; public class ChangeDetails extends... is the mistake in this code! This is working only one record doesn't work
problem in html
problem in html  i want that my custmer can upload file or video on my website so plz help and send me the code which i can paste on my web site so people can upload their video and img and plz send the html code becaz my web
java script code problem - Java Beginners
java script code problem  Dear sir, my problem is that, suppose i've two HTML files(with java script), out of them one has function EMPLOYEE_DETAILS() i want to call this EMPLOYEE_DETAILS() fuction to another Html file, how
change cursor on my website - WebSevices
change cursor on my website  i want to change cursor on website. i am new in php. Please tell me it is possible to php.   Hi friend, Code to help in solving the problem : Test function cursor_wait
Applet run with appletviewer but not in browser, any code problem.
can be problem in code also. please check my code. 1) Card.java package...Applet run with appletviewer but not in browser, any code problem.  Hi,My problem is when I am running my applet in appletviewer index.html, Its work
problem
;Hi, What do you want to do with this code. Please clarify
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field.... Please suggest me what will the code
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field.... Please suggest me what will the code
Servlet problem
connectivity code it works but problem is with servlet page. My servlet code... problem from last three month and now i hope rose india developers will definitely help me. I built a web application using jsp, servlets . My web application
details of my program - Java Beginners
details of my program  hi 1- allow the customer to order any thing... the customers... and about the last posted code it dis not run too and the problem was with scanners method i hope its clear for you now .... i know its

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.