• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to initiate hashtable and linklist

 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing project by using Spring 3.0, JSF 2 . so what my requirement is when application load at first time load the some data to HashTable and ArrayList(whatever Collection). this is my web.xml file


how i can use init param to load some data to HashTable or ArrayList. give me your valuable comment..

Thanks in Advance
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for valuable link.what I want is when application load at first time load the some data to HashTable and ArrayList from database table. how i can manage it?
Thanks in advance..........
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar Rohankar wrote:May be Serlvet context listener helps:
http://download.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html


Sorry Sagar. How do you even know if they have a web application?

For a Spring application, and for some simple task like what is needed here, a ContextListener is way overkill.

So an init-method is just a method that runs right after an object gets instantiated and all its dependencies and properties have been set.






SomeClass will be instantiated by Spring, the dataSource dependency will be injected, any properties will be set, then the someMethod method will be called.

That is how init-method works.

Mark
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have solved my problem by using spring. i have add spring bean to execute when application loading time.

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark Spritzler wrote:
Sagar Rohankar wrote:May be Serlvet context listener helps:
http://download.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html

Sorry Sagar. How do you even know if they have a web application?

Well, I guess that from the web.xml posted!

Definitely, for init-method
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar Rohankar wrote:Well, I guess that from the web.xml posted!


DOH!. See how much I pay attention to the details. ;)

Mark
 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all valuable posts................
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic