hi,
sorry for causing inconvenience.
Here is the bean class code:
import java.io.*;
public class UserInfobean implements Serializable
{
private
String uname;
public UserInfobean()
{
}
public void setUserName(String newName)
{
uname=newName;
}
public String getUserName()
{
return uname;
}
} //end of class
And here is the JSP code:
<html>
<body>
<%@ page import="java.sql.*" %>
<%@ page import="UserInfobean.class" %>
<%! Connection con;
PreparedStatement ps;
ResultSet rs;
Statement st;
//String title,fname,lname,usrname,pwd,dob,sex,address,city,state,country,zipcode;
String usrname,passwd,uname,pwd;
//int ret;
public void jspInit()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc
dbc:sanemp");
}
catch(Exception e)
{
out.println(e);
}
}
%>
<%
try
{
usrname=request.getParameter("username");
passwd=request.getParameter("password");
ps=con.prepareStatement("select * from registeredusers where username=? and password=?");
ps.setString(1,usrname);
ps.setString(2,passwd);
rs=ps.executeQuery();
if(rs.next())
{
%>
<jsp:useBean id="userinfo" class="UserInfobean">
<jsp:setProperty name="userinfo" property="*"/>
</jsp:useBean>
<jsp:forward page="/inbox.jsp" />
<%
}
else
{
%>
<jsp:forward page="/sanmail1.jsp" />
<%
}
}
catch(Exception e1)
{
out.println("<b>"+e1+"</b");
}
%>
</body>
</html>
When I run the above JSP page, i found that there is no _jspService method in the JAVA file(which is present in the tmpdir\...). I'm getting an error that - there is no _jspService method.
Where did I go wrong?
I'm a newbie to this JSP concept.
Please help me out...
regds,
Sandeep.....