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!

Cannot be resolved to be a type, what does this mean?

843838Feb 13 2006 — edited Jul 18 2009
I have a welcome.jsp page, which has a button. when user clicks the button, a new jsp page providing a welcome message is shown. I have java program, in which i have written the connections. The java program is working properly. But when the control transfers to the second jsp page, am encountering a server error.
To link the java program with the second jsp page, i have written the code in second jsp page as :

<%@ page import="project.LoginJdbc"%>

I also created a object for the java program to call it,

<% LoginJdbc obj =new LoginJdbc(); %>

when i execute the program, i get the error as :

Generated servlet error:
Only a type can be imported. project.LoginJdbc resolves to a package

An error occurred at line: 6 in the jsp file: /two.jsp
Generated servlet error:
LoginJdbc cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /two.jsp
Generated servlet error:
LoginJdbc cannot be resolved to a type
****************************************************
Here LoginJdbc is my java page. It is inside the package project

what does this cannot be resolved to a type mean?
what is only a type can be imported mean?

In the same code, when i used * with the import statement, am not getting the only a type can be imported error..

<%@ page import="project.LoginJdbc.*"%> // like this

can anyone help me with including java code with jsp. I need to use seperate code for java and jsp. That is the java page should have all the connection establishment, and when i import the java page in jsp, it should work?

please help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2009
Added on Feb 13 2006
19 comments
4,688 views