Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Load the beanrefContext.xml in web Application

 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello All,

i am a newbie to Spring Framework.

I have a beanrefContext.xml configured .

Can anybody please tell me how can i load this beanrefContext.xml into my Application .

Thanks in advance.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

RaviNada Kiran wrote:
Hello All,

i am a newbie to Spring Framework.

I have a beanrefContext.xml configured .

Can anybody please tell me how can i load this beanrefContext.xml into my Application .

Thanks in advance.



What is in that file? Is that the file that you use to get Beans into EJBs? I forgot?

Where do you want that xml loaded. In the ApplicationContext when you create it? Then isn't it just passed as a parameter to the constructor of ApplicationContext, or if in a web environment, then added as a context-param for the ContextLoaderListener?

Thanks

Mark

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mark Spritzler wrote:

RaviNada Kiran wrote:
if in a web environment, then added as a context-param for the ContextLoaderListener?



Hi Mark , thanks for your valuable answer . For this i did these

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationcontext.xml</param-value>
</context-param>

and i declared a ContextLoaderListener in my web.xml

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


what i want to ask is these above two steps are sufficient ?? so that with the help of predefined annotated tags we can gain access to the resources defined inside the applicationcontext.xml

 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those two lines loads an ApplicationContext into the WebContext so that your Web apps/Controllers have access to beans defined in your applicationContext.xml

But what do you have in
beanrefContext.xml

That you mentioned. I believe that is the name of the file that you use when you want an EJB to have access to an ApplicationContext object.

Mark
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark

This beanref ml file would be loading applicationcontext.xml file in its constructor.
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

RaviNada Kiran wrote:Thanks Mark

This beanref ml file would be loading applicationcontext.xml file in its constructor.



And xml file doesn't have a constructor, so I don't understand what you mean. Maybe post some code.

Are you using EJBs?

Thanks

Mark
 
That new kid is a freak. Show him this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic