Author |
Topic: Problem in java (Read 1023 times) |
|
gotit
Uberpuzzler
Gender:
Posts: 804
|
|
Problem in java
« on: Feb 14th, 2008, 6:58am » |
Quote Modify
|
I am visiting this forum after a long time as I was busy with my project. And ironically it is this project that brings me back to the forum. Before I state my problem, let me inform you that I am working with jdk 1.5 and tomcat 5.5. Now for the problem: I create a package called "mypack" and a class called testClass.java. I compile the java file and put the testClass.class file in the mypack directory. I then put the entire mypack directory under webapps/testcodes/WEB-INF/classes directory. Now I create a JSP file which contains the following line <%@ page language="java" import ="mypack.testClass" %> and I create an object of testClass. But when I compile the jsp file, I get an error which says that testClass cannot be resolved. Can anyone please give a solution to this. It's urgent.
|
|
IP Logged |
All signatures are false.
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: Problem in java
« Reply #1 on: Feb 14th, 2008, 7:09am » |
Quote Modify
|
It sounds right. Have you declared the package in the source of testClass? Usually class names start with an uppercase. Do you mix up the cases? Can you otherwise execute JSP pages?
|
« Last Edit: Feb 14th, 2008, 7:10am by Grimbal » |
IP Logged |
|
|
|
SMQ
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 2084
|
|
Re: Problem in java
« Reply #2 on: Feb 14th, 2008, 7:17am » |
Quote Modify
|
It looks to me like you're doing everything right; is it possible that tomcat is running under an older version of Java than what you're compiling with? --SMQ
|
|
IP Logged |
--SMQ
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: Problem in java
« Reply #3 on: Feb 14th, 2008, 7:20am » |
Quote Modify
|
Have you restarted tomcat after copying the .class file to the classes directory?
|
|
IP Logged |
|
|
|
gotit
Uberpuzzler
Gender:
Posts: 804
|
|
Re: Problem in java
« Reply #4 on: Feb 14th, 2008, 9:15pm » |
Quote Modify
|
Yes to all except Grimbal's last question. After reading Grimbal's last question, I restarted Tomcat and it worked!! Thanks a lot Grimbal and SMQ.
|
« Last Edit: Feb 14th, 2008, 9:16pm by gotit » |
IP Logged |
All signatures are false.
|
|
|
gotit
Uberpuzzler
Gender:
Posts: 804
|
|
Re: Problem in java
« Reply #6 on: Feb 15th, 2008, 2:49am » |
Quote Modify
|
No. This is not a one-week project. But since it is currently in the development phase, I have added the following in conf/context.xml file: <Context reloadable="true"> But I understand that once the project goes live, this might degrade the performance and I have to remove the reloadable attribue. I suppose this is what you meant.
|
|
IP Logged |
All signatures are false.
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: Problem in java
« Reply #7 on: Feb 15th, 2008, 5:25am » |
Quote Modify
|
That's not what I meant. In fact, your idea is better.
|
|
IP Logged |
|
|
|
|