This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Load the beanrefContext.xml in web Application

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • 0
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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
  • 0
  • 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
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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
  • 0
  • 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
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic