This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Making a context listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Making a context listener" Watch "Making a context listener" New topic

Making a context listener

Owen Giles

Joined: Oct 22, 2006
Posts: 1

I am quite new to the subject of servlets, JSP and J2EE in general.
I have been working through the excellent Head First Servlets & JSP book and I am currently trying to complete the tutorial on context listeners.

I have created a new webapp called listenerTest in Tomcat 5.5, creating the following directory structure


In example directory I have created three classes -, and, all of which
import package com.example; compiles fine as it does not reference either of the other 2 classes but when I try and compile the others (which both take an object of type Dog) neither can find the symbol 'Dog'.,

The error msg is as follows cannot find symbol
symbol : class Dog
location class com.example.ListenerTester

I am thinking it has something to do with either my classpath or the import statement but I cannot get to the bottom of it.
Can anyone suggest where I could look to resolve this?

Thanks in advance

Owen Giles
sven studde
Ranch Hand

Joined: Sep 26, 2006
Posts: 148
What does your question have to do with making a context listener? Rather your question has to do with: "How can I compile my .java files?

all of which import package com.example


When you are having compiling problems (doesn't everybody who programs Java?), you need to post:

1) The directory strucuture
2) The package statements in each file
3) The command you entererd
4) The prompt at which you entered the command

You gave us 1). Post 2), 3), and 4)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

Moved to Java in General(beginner) where compilation issues are best discussed.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Making a context listener
It's not a secret anymore!