T
tfrawley
I have installed Tomcat 6.0.18 and JDK 6u10.
The tomcat server works fine except when I attempt to use a class
file.
The physical path to the test site is: C:\Tomcat6\webapps\test
I placed a file named "index.jsp" in the above site with the following
contents:
<%@ page language="java"%>
<%
test.Hello h = new Hello();
h.run();
%>
I used javac to compile the following class (javac -d Hello.java):
package test;
public class Hello{
public void run(){
System.out.println("Hello World");
}}
and placed the class file in: C:\Tomcat6\webapps\test\WEB-INF\classes
When I open the site I get:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 4 in the jsp file: /index.jsp
test.Hello cannot be resolved to a type
1: <%@ page language="java"%>
2:
3: <%
4: test.Hello h = new Hello();
5: h.run();
6: %>
7:
An error occurred at line: 4 in the jsp file: /index.jsp
Hello cannot be resolved to a type
1: <%@ page language="java"%>
2:
3: <%
4: test.Hello h = new Hello();
5: h.run();
6: %>
7:
This seems so simple but it refuses to work. What am I doing wrong!?!?
The tomcat server works fine except when I attempt to use a class
file.
The physical path to the test site is: C:\Tomcat6\webapps\test
I placed a file named "index.jsp" in the above site with the following
contents:
<%@ page language="java"%>
<%
test.Hello h = new Hello();
h.run();
%>
I used javac to compile the following class (javac -d Hello.java):
package test;
public class Hello{
public void run(){
System.out.println("Hello World");
}}
and placed the class file in: C:\Tomcat6\webapps\test\WEB-INF\classes
When I open the site I get:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 4 in the jsp file: /index.jsp
test.Hello cannot be resolved to a type
1: <%@ page language="java"%>
2:
3: <%
4: test.Hello h = new Hello();
5: h.run();
6: %>
7:
An error occurred at line: 4 in the jsp file: /index.jsp
Hello cannot be resolved to a type
1: <%@ page language="java"%>
2:
3: <%
4: test.Hello h = new Hello();
5: h.run();
6: %>
7:
This seems so simple but it refuses to work. What am I doing wrong!?!?