Y
Yamin
Hi all,
I'm just started off learning a bit of jsp and jservlets. I got the basic
setup to run. But I'm having a slight problem here.
The SETUP:
Apache 2.0 / Tomcat 5.0
-testing and working...using samples
***************************************
The jsp page = test.jsp
G:\www/Tomcat 5.0\webapps\test
test.jsp
G:\www\Tomcat 5.0\webapps\test\WEB-INF
web.xml
G:\www\Tomcat 5.0\webapps\test\WEB-INF/classes
crazyClass.java, crazyClass.class, crazyClass.jar
G:\www\Tomcat 5.0\webapps\test\WEB-INF\lib
catalina-root.jar
***************************************
test.jsp
************************************
<HTML>
<BODY>
<H1><%= "Test!" %></h1><%= "at " +
java.util.Calendar.getInstance().getTime() %>
<H2><%= " Line test" %></h2><%= "at " + crazyClass.getValue() %>
</BODY>
</HTML>
*************************************
crazyClass.java (compiles fine)
**********************************
import java.io.*;
import java.text.*;
import java.util.*;
public class crazyClass
{
public static int x = 0;
public static String getValue()
{
x++;
return Integer.toString(x);
}
}
*************************************
THE PROBLEM:
within test.jsp, if I don't include the line: <H2><%= " Line test"
%></h2><%= "at " + crazyClass.getValue() %> everything works fine and I get
the date printed out. Once I include the line, I get a tomcat error saying
cannot resolve symbol crazyClass
I guess this means it can't find crazyClass.class. As far as my
understanding goes, by putting crazyClass.class in the WEB-INF/classes
directory, it should be found by the compiler when it compiles test.jsp? Or
is that not right and I have to explicity change the java classpath each
time I have a new project to add to tomcat?
If its the classpath problem, anyone know what the norm is to solve it?
Change the CLASSPATH environment var? Add a classpath option to the tomcat
JAVA VM configuration?
Thanks for any help,
Yamin
I'm just started off learning a bit of jsp and jservlets. I got the basic
setup to run. But I'm having a slight problem here.
The SETUP:
Apache 2.0 / Tomcat 5.0
-testing and working...using samples
***************************************
The jsp page = test.jsp
G:\www/Tomcat 5.0\webapps\test
test.jsp
G:\www\Tomcat 5.0\webapps\test\WEB-INF
web.xml
G:\www\Tomcat 5.0\webapps\test\WEB-INF/classes
crazyClass.java, crazyClass.class, crazyClass.jar
G:\www\Tomcat 5.0\webapps\test\WEB-INF\lib
catalina-root.jar
***************************************
test.jsp
************************************
<HTML>
<BODY>
<H1><%= "Test!" %></h1><%= "at " +
java.util.Calendar.getInstance().getTime() %>
<H2><%= " Line test" %></h2><%= "at " + crazyClass.getValue() %>
</BODY>
</HTML>
*************************************
crazyClass.java (compiles fine)
**********************************
import java.io.*;
import java.text.*;
import java.util.*;
public class crazyClass
{
public static int x = 0;
public static String getValue()
{
x++;
return Integer.toString(x);
}
}
*************************************
THE PROBLEM:
within test.jsp, if I don't include the line: <H2><%= " Line test"
%></h2><%= "at " + crazyClass.getValue() %> everything works fine and I get
the date printed out. Once I include the line, I get a tomcat error saying
cannot resolve symbol crazyClass
I guess this means it can't find crazyClass.class. As far as my
understanding goes, by putting crazyClass.class in the WEB-INF/classes
directory, it should be found by the compiler when it compiles test.jsp? Or
is that not right and I have to explicity change the java classpath each
time I have a new project to add to tomcat?
If its the classpath problem, anyone know what the norm is to solve it?
Change the CLASSPATH environment var? Add a classpath option to the tomcat
JAVA VM configuration?
Thanks for any help,
Yamin