This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing 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 all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

problem with JSP  RSS feed

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

i want to know about following pgm please:

The problem is in process.jsp the line is if()).IT SHOWS ERROR MSG IN (idHandler.validate()) (as attached)

please help me with it

(----------------html page----------------------------------------)
<title>Nouman Rashid page </title>

<p> <h3><center>Please enter your user name and

<form action="process2.jsp " method = "post" >
<center><input type = "text" name=
<center><input type = "password" name =
<center><input type="submit" name="Submit"



(------------------------------jsp page----------------------------------)


<%@ page import="java.util.*" %>
<jsp:useBean id="idHandler" class="foo.Login" scope="request">
<jsp:setProperty name="idHandler" property="*"/>

if (idHandler.validate()) {
<jsp:forward page="success.jsp"/>
} else {
<jsp:forward page="retry.jsp"/>



package foo;
import java.sql.*;

public class Login {

private String username = "";
private String password = "";

public Login() {

public void setUsername(String username) {
this.username = username;

public void setPassword(String password) {
this.password = password;

public boolean authenticate(String username2,
String password2) {
String query="select * from Registration;";
String DbUserName="";
String DbPassword="";
String finalUser="";
try {
Statement stat=con.createStatement();
ResultSet rst=stat.executeQuery(query);



if (username2.equals(DbUserName) &&
password2.equals(DbPassword)) {


return true;
}catch(Exception e){

return false;

[ September 16, 2008: Message edited by: Bear Bibeault ]
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

your are accessing Login bean through jsp:usebean direcive
and your trying to call validate() function of login bean which is not exist.
Add validate function toyour login class or try to call existed function.

Author and ninkuma
Posts: 66810
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by kanna prasanth:
i want to know about following pgm please:

A few things to help you get answers an JavaRanch:

Firstly, please use real words when posting to the forums. Abbreviations such as "pgm" in place of "program" only serve to make your posts more difficult to read and less likely to generate useful responses. Please read this for more information.

Secondly, please avoid posting in all uppercase. It's considered shouting and rude. Please read this for more information. I have adjusted the topic title for you.

And lastly, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "problem with jsp" in a forum completely dedicated to questions on JSP isn't very helpful.

Please go back and change your post to add a more meaningful subject by clicking the .
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!