Hello,
I am new to Java and attempting to code my first application. I have a query form with textboxes that I'd like to use with a databean. I get a compiler error complaining that my class attribute is invalid. I've tried everything I can think of. I have a public constructor, my classpath should be correct - notes below. I also tried compiling this file from the command line, but received an error saying javac could not find the file. It's there though. I read other posts on this site but wasn't able to resolve the issue. Your help would be greatly appreciated.
This is my searchdata.java file.
package querydata;
public class queryBean{
private String title;
private String author;
private String yearOfPub;
private String date;
public queryBean()
{
title = "";
author = "";
yearofPub = "";
date = "";
}
public String setTitle(String Title)
{
title = Title;
}
public String getTitle()
{
return title;
}
public String setAuthor(String Set_Author)
{
author = Set_Author;
}
public String getAuthor()
{
return author;
}
public String setYearofPub(Year_of_Pub)
{
year = Year_of_Pub;
}
public String getYearofPub()
{
return year;
}
public String setDate(Date)
{
date = Date;
}
public String getDate()
{
return date;
}
}
This is the bean in my search.jsp file. I haven't included the search form, I didn't think it was relevant to the question.
<%@ page import="querydata.queryBean.*"%>
<jsp:useBean id="querybean" class="querydata.queryBean" scope="session">
</jsp:useBean>
searchquery.java is stored in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\searchquery
My classpath is set to C:\Program Files\Java\jdk1.6.0_06\bin, and the javac.exe file is there - I checked.