The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Nested tags....Cooperating tags!!!...phew.... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Nested tags....Cooperating tags!!!...phew...." Watch "Nested tags....Cooperating tags!!!...phew...." New topic
Author

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

faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
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

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


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
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
Whats your CLASSPATH like when you compile ?
- satya
Ian B Anderson
Ranch Hand

Joined: Jun 26, 2001
Posts: 275
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 ]

<a href="http://www.INESystems.com/scbcd/" target="_blank" rel="nofollow">http://www.INESystems.com/scbcd/</a> - SCBCD Exam simulator<br /><a href="http://www.INESystems.com/scbcd/" target="_blank" rel="nofollow">http://www.INESystems.com/scea/</a> - SCEA Exam simulator
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
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
How about appending a ;. to your classpath?
Set Classpath=%Classpath%;.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
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
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
Faiza,
do this:
instead of:
faiza haris
Ranch Hand

Joined: Oct 17, 2000
Posts: 173
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
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
 
 
subject: Nested tags....Cooperating tags!!!...phew....
 
Threads others viewed
Reg : doubt
Assigning object references of different types
inner classes help
query on method over riding
Instance Creation Through Spring Bean Injection
IntelliJ Java IDE