This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Problems with package declarations in a web app  RSS feed

 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure where the best place is for this question, because I'm not entirely sure what the problem is.
Basically, I have a web app that works fine. It's under c:\resin\webapps\updater\WEB-INF\classes\. All the related .class files are there, jsp files are elsewhere (not have a problem with those).
Now the problem comes up that I want to have a similar web app, but it's a sample version. It uses a majority of the same resources that the "production" one does, but has some modification to its classes.
So what I did was created a "Sample" package under the classes directory, and stuck all the modified classes under there (and also the ones that I didn't modify, but still copied to this package). I put a package statement in each of the classes. So yes, there are some duplicates, but oh well, that's the least of my problems.
Now, everytime that I want a class that is within this package to access another class with the same package, I have to hard code "sample.ClassName" anywhere in my code that I call another class. If I don't, I get all sorts of ClassCast exceptions, etc.
Is there something specific to the servlet container that I need to modify to make it so that I don't have to write "sample.ClassName" for every class that is accessed, even from with the sample package?
*begins babbling incoherently*
Ps. Feel free to move this if the answer has nothing to do with servlets, containers, etc.
 
jason adam
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And my web.xml file looks like:
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!