Results 1 to 3 of 3
  1. #1
    grinsalot is offline Member
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

    Default Invalid usebean class attribute - new to java

    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.


    Java Code:
    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.

    Java Code:
    <%@ 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.

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    This should be posted in JSP section.... :)
    freedom exists in the world of ideas

  3. #3
    grinsalot is offline Member
    Join Date
    Jul 2008
    Posts
    2
    Rep Power
    0

Similar Threads

  1. Replies: 1
    Last Post: 07-02-2008, 02:15 PM
  2. java.io.IOException: invalid header field
    By osval in forum Advanced Java
    Replies: 1
    Last Post: 08-06-2007, 11:09 PM
  3. Replies: 2
    Last Post: 07-30-2007, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •