• 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

Spring context files

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I have a question about Spring context files.
After checking some examples, I found that these files named like :
rentABike-context , rentABike-servlet, dataAccessContext-local, dataAccessContext-jta ...
So, is there any required schema for this ?
(like JBoss use -ds , -service ...).
One more question, I found a web application that uses Spring, this application uses the following file : rentABike-servlet.xml
But in the code, there is lines like : ClassPathXmlApplicationContext -and the others flavores-.
How could this thing happened ?
Thanks.
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Todd:
Hi.
I have a question about Spring context files.
After checking some examples, I found that these files named like :
rentABike-context , rentABike-servlet, dataAccessContext-local, dataAccessContext-jta ...
So, is there any required schema for this ?
(like JBoss use -ds , -service ...).
One more question, I found a web application that uses Spring, this application uses the following file : rentABike-servlet.xml
But in the code, there is lines like : ClassPathXmlApplicationContext -and the others flavores-.
How could this thing happened ?
Thanks.



No required scheme. You can put them all in one big app context file if you like. My preference is to break them up by package. It keeps the size of the context XML files down, and makes the code in the package portable.

How could what have happened?

Reading the context from the CLASSPATH seems like the right thing to do for a Web app. (It works even if the app is deployed in a WAR file.)

What's the problem?
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yes, but I mean there is no explicit loading using Spring
ApplicationContext or BeanFactory.
[qoute]
My preference is to break them up by package.
[/qoute]
Hmmm, it seems to me that I don't know anything about this.
Would you mind telling me more about this technique ?
After checking samples dir of Spring distribution, I found files like :
applicationContext-hibernate, applicationContext-toplink, petclinic-servlet, ...
Well, please correct me if I'm wrong :
applicationContext-hibernate is used to inject dependencies for classes that use Hibernate, petclinic-servlet inject dependencies for the servlets.
Right ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic