Only a type can be imported. package.Class resolve to a package.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Sunday, October 24, 2010 07:42 AM

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. vidyabha   More>>

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.

   <<Less
About | Sitemap | Contact