Only a type can be imported. package.Class resolves to a package
803360Oct 24 2010 — edited Oct 26 2010Hi,
I made a class for database connection named ConnectionClass.class.
The JSPs in public_html directory working fine with import and session variables.
but JSPs under public_html/subdirectory are unable to import this Class and also unable to access session variables.
I have deploy this class under public_html/WEB-INF/classes/ directory.
and also in a jar file vidyabharti.jar under public_html/WEB-INF/lib directory
I am importing it in JSPs like
<%@ page import="vidyabharti.ConnectionClass, java.sql.*" %>
but i am getting following error
An error occurred at line: 6 in the generated java file
Only a type can be imported. vidyabharti.ConnectionClass resolves to a package
An error occurred at line: 110 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
109: <%
110: ConnectionClass cs=null;
An error occurred at line: 115 in the jsp file: /welcome.jsp
ConnectionClass cannot be resolved to a type
cs=new ConnectionClass();
i am using Tomcat 5.5.28.
please help me.