Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested tags....Cooperating tags!!!...phew....

 
faiza haris
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
faiza haris
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats your CLASSPATH like when you compile ?
- satya
 
Ian B Anderson
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
faiza haris
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about appending a ;. to your classpath?
Set Classpath=%Classpath%;.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Faiza,
do this:
instead of:
 
faiza haris
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic