You don't specify the "java" portion when you import. Simply importing "A" will suffice. In addition, the JSP container might not be able to compile the JSP document when you try and import classes that are part of the default package.
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import= "A" errorPage="" %> Still getting 3 errors- C:\Tomcat\work\Standalone\localhost\app\mypage_jsp.java:8: '.' expected import A; ^ C:\Tomcat\work\Standalone\localhost\app\mypage_jsp.java:116: cannot resolve symbol symbol : class A location: class org.apache.jsp.mypage_jsp A obj = new A(); ^ An error occurred at line: 57 in the jsp file: /mypage.jsp Generated servlet error: C:\Tomcat\work\Standalone\localhost\app\mypage_jsp.java:116: cannot resolve symbol symbol : class A location: class org.apache.jsp.mypage_jsp A obj = new A(); Can you please help me?
Joined: May 29, 2003
Lucky, As I said, Tomcat can't compile a JSP document that tries to import classes that are defined in the default package. (Like your "A" class!) You need to put "A" in an actual package (e.g. com.yourdomain.A). Then it will work.