Share on Google+Share on Google+

sakthi
jsp code error
1 Answer(s)      8 years ago
Posted in : Java Beginners

Ads

View Answers

November 15, 2008 at 12:16 AM


Hi friend ,

Try this code:
<%
Connection conn = dbConn.getConn();
Statement stat=null;
ResultSet rs=null;
try
{
//out.println("Connection success fully ...");
stat=conn.createStatement();
String strId = request.getParameter("txtUserId");
String strPassw = request.getParameter("txtPassword");
String empQuery=("select * from login where password ='" + strPassw +"'");
rs=stat.executeQuery(empQuery);
while(rs.next())
{
String Id=rs.getString("id");
String Passw=rs.getString("password");
if(strId.equals(Id) && strPassw.equals(Passw))
{
out.println("<br>Password :"+Passw);
%>
<jsp:forward page="AdminDisplay.jsp" />
<%
}
else
{%>
/*out.println("Login Failed,Please try Again"); i want to display a message box instead of this*/
<script language="javascript">
<!--
alert("Login Failed,Please try Again");
-->
</script>
<%}
}
}%>









Related Tutorials/Questions & Answers:
code error - JSP-Servlet
code error  hii this program is not working becoz when the mouse... is error in this progrm. ss function describe() { window.status... complaint   Hi friend, Do some changes in your code to solve
jsp code error - JSP-Servlet
jsp code error  hello, is anyone here who can solve my problem. what happen experts where r u? or u r not able to do
Advertisements
jsp code error - JSP-Servlet
jsp code error  hello, is anyone here who can solve my problem. what happen experts where r u? r u not able to do
jsp code error - JSP-Servlet
jsp code error  I have a jsp page named "tMastDepartment".which has some table row containing text box like 'project code','Departmentcode','employee... there is the problem which i am facing.what will be the exact code
jsp code error - Java Beginners
jsp code error  Hi, I have a problem with following code... part. Is it possible to display a message box or alert box in jsp code??. plz help...; Hi friend , Try this code: /*out.println("Login Failed
java Compilation error:jsp code - JSP-Servlet
java Compilation error:jsp code   I am getting an Generated Servlet error: String literal is not properly closed by a double-quote. here is my code: <% { Dbclass2 d= new Dbclass2
jsp code compilation error - JSP-Servlet
jsp code compilation error  hai, iam doing online banking project.i... is the error and also what is the proper code for funds transfer. HTTP... The server encountered an internal error () that prevented it from fulfilling
Code error
Code error  package trail; import...) read.close(); } } } While using this it shows error as: run... seconds) Hw can i correct this code????????   Basically, the Exception
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
JSP error
JSP error  what is difference between global-exception and error-page in jsp. which condition they are use
jsp error
jsp error  <p>hi, could please help whenever i run jsp file in my eclipse i got this error.my jsp file is</p> &lt;%@ page language... encountered an internal error () that prevented it from fulfilling this request
Error in Code - Development process
Error in Code  Hi; This is my code to get all d records from View_Service table but am getting error. I just copied this from net.I am doing mini... name (e.g emp) 6. Click "Ok" and then try the following JSP code where 'access
jsp error - JSP-Servlet
, The 404 or Not Found error message is an HTTP standard response code indicating...jsp error  HTTP Status 404 - /jsp... message /jsp/ description The requested resource (/jsp/) is not available
Upload Code error on deploying
Upload Code error on deploying  on deploying the above code as it is said it is giving error that " No getter method for property thefile of bean org.apache.struts.taglib.html.BEAN " Error 500--Internal Server Error
error in code - JDBC
error in code  hi friends i had one problem when i am running the application of jdbc code it is getting that Exception in thread "main" java.lang.NoSuchMethodError: main plz send me the solution for that error   
Error in a code. - Java Beginners
Error in a code.  This is the question I posted yesterday: "I'm.... I'm confused about where and what i should put into the overall code. Also I can't quite figure out how to write the code for the GUI. Could anyone please help
Swing error in code
Swing error in code  import java.rmi.*; import java.awt.*; import... the following errors: C:\tjm>javac SClient.java SClient.java:29: error: <...() { ^ SClient.java:29: error: illegal start of type b.addActionListener(new
How to create and use custom error page in jsp
How to create and use custom error page in jsp... and use custom error page in jsp and display an error message. Before run... as a .jsp file named "error_page.jsp" in the directory
Code Error - WebSevices
Code Error  How to insert checkbox values to mysql using php  Hi friend, Code to help in solving the problem : Insert CheckBox Thanks
Snippet Code Error
Snippet Code Error  The following is a snippet of code from a Java application which uses Connector/J to query a MySQL database. Identify possible problems and possible solutions. Connection cn= DriverManager.getConnection
jsp error - JSP-Servlet
jsp error  how to remove below error:: exception... not been initialized. Anyways post your code. Thanks  my code... newpo.jsp:   JSP Page
jsp error - JSP-Servlet
jsp error  Hello, my name is sreedhar. i wrote a jsp application... and showing the data base code and the connecction code. please help me to come... sending data insert into database code
JSP Error - JSP-Servlet
JSP Error  When i am running my registration.jsp getting following error. HTTP Status 500... description The server encountered an internal error () that prevented it from fulfilling
JSP Translation error - JSP-Servlet
. ----------------------------------------------- An error occurred at line: 2 in the jsp file: /stud..., in this code there is no error Thanks Rajanikant...JSP Translation error  Hello friends, In a new file
JSP Error 500
JSP Error 500          JSP Error 500 is to generate error status 500 in jsp.  The Error 500 occurred when the server encounter an internal error
jsp code
jsp code  what are the jsp code for view page in online journal
jsp error - JSP-Servlet
jsp error  To Upload and insert the file into oracle Database with Current Date and Time In JSP and my project is online library management system... database. Try the following code: 1)page.jsp: Display file upload form
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
jsp error - JDBC
jsp error   in this code the else part is nt executing atall... of that a error is like-----------"java.sql.SQLException: [Microsoft][ODBC Driver Manager... the line is not getting incremented u r getting that error just do this change
JSP CODE
JSP CODE  what is the code for downloading images from database using JSP?   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads