can't find .class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jason_Bowsher
Posted On:   Tuesday, December 31, 2002 08:35 AM

I get the following error generated when viewing my jsp page. The AdminDatabase.class file in in WEB_INF/classes under my docroot directory. Any suggestions why?. Generated servlet error: [javac] Compiling 1 source file /var/tomcat4/work/Standalone/ /_/ConnectionTest_jsp.java:8: '.' expected import AdminDatabase; ^ /var/tomcat4/work/Standalone/ /_/ConnectionTest_jsp.java:51: cannot resolve symbol symbol : class AdminDatabase location: class org.apache.jsp.ConnectionTest_jsp AdminDatabase adb = new AdminDatabase(); Here is the jsp: <% <%@ page language="java" import ="java.util.Vec   More>>

I get the following error generated when viewing my jsp page. The AdminDatabase.class file in in WEB_INF/classes under my docroot directory. Any suggestions why?.


Generated servlet error:
[javac] Compiling 1 source file


/var/tomcat4/work/Standalone/ /_/ConnectionTest_jsp.java:8: '.' expected
import AdminDatabase;
^
/var/tomcat4/work/Standalone/ /_/ConnectionTest_jsp.java:51: cannot resolve symbol
symbol : class AdminDatabase
location: class org.apache.jsp.ConnectionTest_jsp
AdminDatabase adb = new AdminDatabase();


Here is the jsp:



<%
<%@ page language="java" import ="java.util.Vector, AdminDatabase"%>
AdminDatabase adb = new AdminDatabase();

if (adb.openConnection()!=null)
{ %>
<%//Connected%> <%=adb.openConnection()%>
Connected
<% } else
{ %>
<%//NOT connected %> <%=adb.openConnection()%>
Not Connected
<% } %>

   <<Less

Re: can't find .class

Posted By:   vinay_salehithal  
Posted On:   Tuesday, December 31, 2002 11:09 AM

U need to put AdminDatabase class in a package and then import that package in yr JSP. For eg: say we create a TestClass inside a TestPackage, so source for TestClass wd be:

package TestPackage;

public class TestClass{/*all yr code*/}

Then create a TestPackage folder inside yr WEB_INF/classes.
Place TestClass there and compile it.

Then in yr JSP:

<%@ page import="TestPackage.*" %>

<% TestClass tc = new TestClass(); %>
About | Sitemap | Contact