This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Languages and the fly likes How to have multiple public classes in one file for spring? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "How to have multiple public classes in one file for spring?" Watch "How to have multiple public classes in one file for spring?" New topic
Author

How to have multiple public classes in one file for spring?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
I'm trying to instantiate some classes using spring with java. This is working.

I'm trying to apply this to some automated code generation and I would like to have all my code in a single file.

Unfortunately, java only lets me have one public class in each source code file. When spring tries to instantiate classes that are not public, it cannot.

Is there a way around this java constraint? Maybe some scripting language like groovy?

Thanks,
Siegfried
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
Yup, it works with groovy. Apparently groovy ignores the keyword public in front of classes and makes all classes public.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to have multiple public classes in one file for spring?
 
Similar Threads
Inversion of Control:question
How to configure the Cofiguration file in spring if we want to decide at run time which child object
Including Utility Function & Constants in Servlets
Rookie question on request variable
Spring annotation with inheritance