I have created a Web Project. I already have a simple java project, that has a public class A.
I have included this java project in the classpath of this web project. In the welcome jsp of this project, i have imported this class through the page directive and then in the scriptlet i create an instance of this class.
When i execute the application, i get cannot resolve symbol A. What could be the problem?
Put class A in a package and correctly import the package into the JSP. When classes dont have an explicit package the JVM looks in the "current" directory - something you have no control over in the servlet/jsp environment. ALL classes used in servlets/jsp should be in packages to avoid hard to understand bugs. Bill
Please send the directory structure where your class file resides.
Joined: Jun 07, 2005
yes , i have done both. Compiled the class and well as changed the import as. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="tutorial.databeans.A" %>