• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Making a context listener

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to Java in General(beginner) where compilation issues are best discussed.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic