• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with jsp:useBean tag...URGENT

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everybody,

I'm facing a problem while using <jsp:useBean> tag. When i'm using this tag in a jsp page, it is giving a compile time error.
When I opened the java file(which is present in tmpdir\...), i found that there is no _jspService method.
Would anybody pls tell me the solution and correct syntax.
I'm using JWS2.0 and i'm copying the bean class to classes directory.
Pls reply me asap..
regds,
Sandeep.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Could you please post your jsp & bean class code ?

------------------
Suneel
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want help, DON'T just say "it is giving a compile time error" - post the ACTUAL ERROR MESSAGE! Java compiler error messages will frequently lead you directly to the problem but if you don't post the actual message, we can't help.
Posting the code in the vicinity of where the error occurred is a big help too.
Bill

------------------
author of:
 
Raukutam Sandeep
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.....
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sandeep
Some errors basically.

This is your jsp file.
And this is the generated java file in tmpdir of JWS.


------------------
Suneel
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic