Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Spring
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Spring
Init in Spring
alwz nikhil
Greenhorn
Posts: 2
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
If I have to some sort of initialization like we do in init method of a
servlet
, how we can do in spring based web application?
Thanks
Nathan Pruett
Bartender
Posts: 4121
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
There are multiple ways to do this (depending on why you want to init...) but you probably just want to just write a method on your bean and specify it in the configuration as 'init-method' -
<bean id="myBeanName" class="com.my.Bean" init-method="init"/> package com.my; public class Bean { public void init() { // ... } // ... }
Here's the
Spring 3.x documentation
on lifecycle methods.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Servlet class
Modular Java: flexibility
Can we force JSf beans to call a specific method llike we do in Spring beans
Spring 3.0 query
Any docs for spring javascript?
More...