Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Import cannot be resolved" with JSP

I am trying to call a Java class from a JSP page. I have created the project using JDeveloper.

I am getting an error that says "The import cannot be resolved". I have added the Class file in WEB-INF, root folder, and tried compiling, but it still shows the same error.

Below is the code:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    </head>
    <body>
        <p>  
            <%@ page import="java.util.*"%>
            <%@ page import="Class1"%>
            <% 
                Class1 tc=new Class1("test");
                out.print(tc.str);
            %>
        </p>
    </body>
</html>
like image 882
user1884132 Avatar asked Dec 07 '12 01:12

user1884132


1 Answers

you should give fully qualified name for your class. (packagename.classname) like:

    <%@ page import="pkgname.Class1"%>
like image 172
PermGenError Avatar answered Sep 22 '22 07:09

PermGenError