java+jsp

java+jsp

View Answers

July 25, 2008 at 7:00 PM

Hi friend,

<%@ page language="java" %>
Please enter your Name and Password here:
<br>
<br>
<form name="frm" action="/JSPMultipleForms/Authentication" method="Post" >
Name:&nbsp;&nbsp;&nbsp;<input type="text" name="user" value=""/>
Password:<input type="text" name="pass" value=""/>
&nbsp;&nbsp;&nbsp;<input type="submit" value="Check" />
</form>


---------------------------------

java file

import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class Authentication extends HttpServlet{

private ServletConfig config;

public void init(ServletConfig config)
throws ServletException{
this.config=config;
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException{

PrintWriter out = response.getWriter();
String connectionURL = "jdbc:mysql://192.168.10.59/messagepaging";;
Connection connection=null;
ResultSet rs;
String userName=new String("");
String passwrd=new String("");
response.setContentType("text/html");
try {
// Load the database driver
Class.forName("com.mysql.jdbc.Driver");
// Get a Connection to the database
connection = DriverManager.getConnection(connectionURL, "root", "root");
//Add the data into the database
String sql = "select user,password from User";
Statement s = connection.createStatement();
s.executeQuery (sql);
rs = s.getResultSet();
while (rs.next ()){
userName=rs.getString("user");
passwrd=rs.getString("password");
}
rs.close ();
s.close ();
}catch(Exception e){
System.out.println("Exception is ;"+e);
}
if(userName.equals(request.getParameter("user")) &&
passwrd.equals(request.getParameter("pass"))){
out.println("User Authenticated");
}
else{
out.println("You are not an authentic person");
}
}
}
-------------------------------------------------------

Read for more information.

http://www.roseindia.net/jsp/

Thanks









Related Tutorials/Questions & Answers:
JAVA,JSP,SERVELTS
JAVA,JSP,SERVELTS  plz Send me Login Page by using core java ,Jsp,Servelts
Java - JSP-Servlet
Java  Dear Deepak, In my Project we need to integrate Outlook Express mailing system with java/jsp. thanks & regards, vijayababu.m
Advertisements
Java - JSP-Servlet
Java, JSP vs Servlet  If anyone have idea about how to use all these technologies in one project ..please share with me. Thanks
Java - JSP-Servlet
Java  Hi All, How to integrate Outlook Express with java/jsp. Plase any one help me. thanks®ards, vijayababu.m  Hi Friend, Use the following: Send Mail Thanks
Need help on JAVA JSP
Need help on JAVA JSP  Hi, I have never worked on java and I have been given an assignment where I have to fix existing issues in the tool(created using JAVA JSP). e.g. Tool does not adjust with the resolution of the screen
java/jsp code to download a video
java/jsp code to download a video  how can i download a video using jsp/servlet
JAVA JSP and Servlet - JSP-Servlet
JAVA JSP and Servlet  for sending mail through lan without intenet and also chatting facility for online users using Java JSP & SERVLET code.  Hi Friend, Please visit the following links: http://www.roseindia.net
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java and JSP help
Java and JSP help  I have a website, on my website i have made a form...;title>JSP Form</title> <style> </style>...="myPackage.FileReaderWriter"%> <%@page import="java.util.Vector"%> <%@ page language="java
Java or Jsp code - JSP-Servlet
Java or Jsp code  Hello Sir, How to create the code for the password recovery page(like forgot gmail password question and answer page)using the radion buttons in display the same page in jsp.I need only how to make
Forum In Java or JSP - Development process
Forum In Java or JSP  How do i develop a forum for my website, in either java or JSP ? what is the code, or should i get the source code for developing the forum. PS: Maximum pages in my website are html's only, only i want
Reporting tool for sqlserver2000 with java or jsp
and implementing it to java or jsp   Hi, You can use Jasper Report.ADS...Reporting tool for sqlserver2000 with java or jsp  Hi to all... in Java. But Jasper is the Best. View list of all Open Source Charting
multiuser in java/jsp? - JSP-Servlet
multiuser in java/jsp?  Hi!!! Rose India Team, Kindly let me know what is exact meaning of multiuser in java? I made an web application using jsp... friend, Multi User in Jsp : More then one User can access in Web appication
Project on mailing system using Java/JSP
Project on mailing system using Java/JSP  I am making a project on mailing system in Java/JSP. How could I display the inbox messages on the home page of user? Please tell me about how to handle these messages in database
java with jsp and dynamic database retrival for bar charts
java with jsp and dynamic database retrival for bar charts  Hi, I am having a table name tablelogin,it consists of columns userid,logintime,sessionid,ip_address,logout. so,can any one help me out how to get the bar chart
java jsp
java jsp  please I want code to parse a web page using Dom parser, thanks
Java jsp
Java jsp  What is JSP
java jsp
java jsp  it is : javax.servlet.jsp only but getting error wt is reason?   Use javax.servlet.jsp.* in your code
java/jsp
java/jsp  In a JSP program called books.jsp, the Java code out.print(request.getParameter(ā??numberā??)); displays "1111111ā??. What are the possible ways for the parameter number to have got its value
java - jsp
java - jsp  program to view and update employee name using JSP without database
Convert the excel sheet data into oracle table through java or jsp
Convert the excel sheet data into oracle table through java or jsp  Hi Friends, Let me help this issue i am phasing Convert the excel sheet data into oracle table through java or jsp
How to export web page to excel using java or jsp or servlets
How to export web page to excel using java or jsp or servlets  Hi I am trying to export web page(jsp page ) to excel using jsp or servlets. I am... errors. Please can anyone tell me how to do this using java or jsp or servlets
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
java, - JSP-Interview Questions
java,  hi.. define URI? wht is difference b/w URL and URI wht are the diffrent types Sessions in Servelts define wht is meant throw? define wht is meant throws? and diffrence b/w throw and throws    URI
java - JSP-Interview Questions
java  1. why implicit object "Exception" is difference from other implicit objects? 2. what is the meaning of exception page & exception in jsp directive
java - JSP-Servlet
java  selected strings clicks right arrow goto shows in another listbox and as it is stored into table type to the next jsp page
java - JSP-Servlet
JAVA - JSP-Servlet
Java servlets sessions session tracking  How to track the session in Servlet
java - JSP-Servlet
tasks on java - JSP-Servlet
tasks on java  hi all, i am a beginner in java language ,i would like to practice some tasks in java..i have an idea about servlets, how to write code .so please can anyone forward a site which contains tasks on java
java - JSP-Servlet
java  hi friends plz give basic information about Taglibraries,Jstl,CoustamTags with ex?   Hi friend, Read for more information. http://www.roseindia.net/jsp/ amardeep  
JAVA - JSP-Servlet
JAVA - JSP-Servlet
JAVA  IN JSP NEXT,DELETE,SAVE,CANCEL,PREVIOUS BUTTON CODES,  Hi Friend, Try the following code: ID Name Address Contact
java - JSP-Servlet
java - JSP-Servlet
java  Hi......I want the java projects and source code of it and explanation for the projects can any one help me outt....and also suggest me where to do the projects to get real time exp ....hope some one will help mee...mail
java - JSP-Servlet
java - JSP-Servlet
java  how to upload a pdf file in a jsp page using servlet

Ads