Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Only a type can be imported. package.Class resolves to a package

803360Oct 24 2010 — edited Oct 26 2010
Hi,

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.
This post has been answered by 799299 on Oct 24 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2010
Added on Oct 24 2010
7 comments
5,930 views