Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. [EDIT] CLASS cannot be resolved to a type

[EDIT] CLASS cannot be resolved to a type

Scheduled Pinned Locked Moved Java
javaquestiondatabasehelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AmbiguousName
    wrote on last edited by
    #1

    Hello. I am trying to write small java bean. The classes for java beans compile successfully. When I try to use them in my .jsp file I get the error

    DatabseDAO cannot be resolved to a type // in the browser

    Here are declarations for these beans

    // DAO class - in file 1
    import java.sql.*;
    import java.io.*;
    import java.util.*;

    public class DatabseDAO implements Serializable
    {
    /// ........... all the code here
    }

    // bean class - in file 2
    import java.io.*;

    public class PersonBean implements Serializable
    {
    /// ........... all the code here
    }

    And here is how I use them in jsp file

    		<%
    			DatabseDAO db2 = new DatabseDAO();
    			
    			ArrayList persons\_list = db2.GetPersons("SELECT \* FROM People");
    			PersonBean person\_bean = null;
    			
    			for (int i=0; i			
    		
    				
    					<% =person\_bean.getPersonId() %>
    					<% =person\_bean.getPersonName() %>
    					<% =person\_bean.getPersonAddress() %>
    				
    		<%
    			}
    		%>
    

    The classes (bean and DAO) are not declared in any package. What is wrong here ?

    This world is going to explode due to international politics, SOON.

    L A 2 Replies Last reply
    0
    • A AmbiguousName

      Hello. I am trying to write small java bean. The classes for java beans compile successfully. When I try to use them in my .jsp file I get the error

      DatabseDAO cannot be resolved to a type // in the browser

      Here are declarations for these beans

      // DAO class - in file 1
      import java.sql.*;
      import java.io.*;
      import java.util.*;

      public class DatabseDAO implements Serializable
      {
      /// ........... all the code here
      }

      // bean class - in file 2
      import java.io.*;

      public class PersonBean implements Serializable
      {
      /// ........... all the code here
      }

      And here is how I use them in jsp file

      		<%
      			DatabseDAO db2 = new DatabseDAO();
      			
      			ArrayList persons\_list = db2.GetPersons("SELECT \* FROM People");
      			PersonBean person\_bean = null;
      			
      			for (int i=0; i			
      		
      				
      					<% =person\_bean.getPersonId() %>
      					<% =person\_bean.getPersonName() %>
      					<% =person\_bean.getPersonAddress() %>
      				
      		<%
      			}
      		%>
      

      The classes (bean and DAO) are not declared in any package. What is wrong here ?

      This world is going to explode due to international politics, SOON.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Shouldn't DatabseDAO be declared public?

      1 Reply Last reply
      0
      • A AmbiguousName

        Hello. I am trying to write small java bean. The classes for java beans compile successfully. When I try to use them in my .jsp file I get the error

        DatabseDAO cannot be resolved to a type // in the browser

        Here are declarations for these beans

        // DAO class - in file 1
        import java.sql.*;
        import java.io.*;
        import java.util.*;

        public class DatabseDAO implements Serializable
        {
        /// ........... all the code here
        }

        // bean class - in file 2
        import java.io.*;

        public class PersonBean implements Serializable
        {
        /// ........... all the code here
        }

        And here is how I use them in jsp file

        		<%
        			DatabseDAO db2 = new DatabseDAO();
        			
        			ArrayList persons\_list = db2.GetPersons("SELECT \* FROM People");
        			PersonBean person\_bean = null;
        			
        			for (int i=0; i			
        		
        				
        					<% =person\_bean.getPersonId() %>
        					<% =person\_bean.getPersonName() %>
        					<% =person\_bean.getPersonAddress() %>
        				
        		<%
        			}
        		%>
        

        The classes (bean and DAO) are not declared in any package. What is wrong here ?

        This world is going to explode due to international politics, SOON.

        A Offline
        A Offline
        alexey_s
        wrote on last edited by
        #3

        Where is your import on .jsp page? Should be

        <%@page import=".DatabseDAO" %>

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups