tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Full Package Names??
Date Mon, 29 Sep 2003 20:21:37 GMT

Howdy,

>I'm just starting to use Tomcat (4.1.27) and I'm trying to get my
existing
>app to work.  It worked fine with JRun, but it seems that Tomcat
requires
>that I specify the full package name for a class whenever I use it??
Is
>this true?

No, tomcat does not required that.  Tomcat follows the Java Language
Specification regarding package imports, as all servers should.

>For example,  I get, "cannot resolve symbol" for the following:
>------------------------------
>import com.fgic.Utility.*
>Utility util = new Utility();

You need a semicolon at the end of the import statement.  You also
probably mean import com.fgic.Utility; rather than import
com.fgic.Utility.*;

>------------------------------
>But when I change it like below, it works fine:
>
>import com.fgic.Utility.*
>com.fgic.Utility util = new com.fgic.Utility();

That's because your import statement is flawed.  I don't buy that the
above works fine as it shouldn't even compile.

>So does this means I have to go through all my code and specify the
full
>package name everywhere?

No.

>Note: in JRun, I didn't even have to specify the package name in the
import
>statement.  It was able to find it with just: import Utility.*

That's strange at best.

In general, you have to import classes you use, or use their fully
qualified name if you don't import them.

If you post the entire relevant piece of code along with the compilation
errors in full, we could help more.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


Mime
View raw message