File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Making a context listener" Watch "Making a context listener" New topic
Author

Making a context listener

Owen Giles
Greenhorn

Joined: Oct 22, 2006
Posts: 1
Hi,

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

webapps/listenerTest/WEB-INF\classes\com\example

In example directory I have created three classes - Dog.java, MyServletContextListener.java and ListenerTester.java, all of which
import package com.example;

Dog.java 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
ListenerTester.java:19: 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

Why?

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
Marshal

Joined: Jan 10, 2002
Posts: 61603
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making a context listener