Hi there I am having trouble compiling the Nested tag classes. The example is from the Prof. JSP wrox book pg 344 where there are two classes, Parent and Child extending TagSupport and BodyTagSupport respectively. When i compile the Child class it gives a compiler error at
error: unresolved symbol Parent and i am unable to solve this problem!!! Can anyone plz guide me as how to deal with nested classes??? thanx for the help! faiza
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
error: unresolved symbol Parent and i am unable to solve this problem Is the Parent.class in the CLASSPATH when you try compile the child java file? Are they in different packages or something? If possible, post the code so I can take a look. - satya
yeah the parent class is in the classpath and heres the code Parent class
Child class
and it gives compilation error with child class thanx for the help! faiza
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
Whats your CLASSPATH like when you compile ? - satya
Ian B Anderson
Ranch Hand
Joined: Jun 26, 2001
Posts: 275
posted
0
Hello, I just cut and pasted the code and it compiled fine. I used the following command: javac -classpath . com\wrox\projsp\ch10\*.java I executed this command from the directory one down from the com directory. Hope this helps. Ian [ January 25, 2002: Message edited by: Ian B Anderson ]
I have both the Parent and Child.java files in c:/myservlets and i'v set the environment from this dir. Everything works fine, but howcome this program. Letme try playing with classpath thingi! thanx guys...i'll tell wht happened! faiza
Axel Janssen
Ranch Hand
Joined: Jan 08, 2001
Posts: 2164
posted
0
How about appending a ;. to your classpath? Set Classpath=%Classpath%;.
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
I have both the Parent and Child.java files in c:/myservlets
package com.wrox.projsp.ch10; You see the problem........ :roll: How about appending a ;. to your classpath? Set Classpath=%Classpath%;. ummmm.....pst!!! Not sure how this would solve the problem.
- satya
faiza haris
Ranch Hand
Joined: Oct 17, 2000
Posts: 173
posted
0
Hi Following is the classpath setting command file: cd myservlets cd coreservlets set CATALINA_HOME=C:\Tomcat set TM_HOME=C:\Tomcat set JAVA_HOME=C:\jdk1.3 set FA_HOME=c:\MyServlets\coreservlets set CLASSPATH=%JAVA_HOME%\lib\tools.jar;C:\MyServlets;%TM_HOME%\lib\jasper-runtime.jar;%TM_HOME%\lib\namingfactory.jar;%TM_HOME%\common\lib\servlet.jar;%TM_HOME%\common\lib\tools.jar;% TM_HOME%\common\lib\resources.jar;%TM_HOME%\common\lib\naming.jar;%TM_HOME%\common\lib\jndi.jar; set PATH=%TM_HOME%\bin;%JAVA_HOME%\bin;%PATH%
javac -d %TM_HOME%\webapps\ch10\WEB-INF\classes Child.java and it works well for other programs but its just this nested thingi....Besides only the compiled Parent class should be visible to the Child and i'm compiling Parent first.... let me totally change the dir structure , do u think that would help? thanx again faiza
Sita Kotamraju
Ranch Hand
Joined: Nov 30, 2001
Posts: 60
posted
0
Faiza, do this: instead of:
faiza haris
Ranch Hand
Joined: Oct 17, 2000
Posts: 173
posted
0
Thanx Satya! I got your point and it works! What is your strategy for preparation, if i may ask and when are u giving the test? faiza
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
What is your strategy for preparation, if i may ask and when are u giving the test? Sure you can ask. Currently my thought is that I will take it in March but don't hold me for that. That date may well become July.... I am reading the Specs. JSP Specs seem to be more readable than the Servlet Specs. I am also reading the More Servlets and JSPs. And ofcourse participating here. Also, currently I haven't made up my plans abt where to watch Superbowl. So I am open on that one...... - satya