Anand Jayabalan

Greenhorn
+ Follow
since Mar 11, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anand Jayabalan

Thanks Linh and Nate. I'll explicitly inject the bean into the Controller rather than getting it from the app context.

I learn a lot from your explanations. Thanks much.

-Anand
You'da man, Nate! This worked just fine and this is exactly what I was looking for Appreciate your help.

Another doubt came up in my mind though when I implemented this. What would be the best way access such an object (viz., "myKey") from a Controller?

Since I have created a bean entry for MasterDataLoader in the config xml for the setServletContext() method to be called, can I just inject the masterDataLoader into the Controller or is it possible to get the object directly from the application scope (if so, how?)? Which is better practice?

Thanks
Thanks. But now this brings me back to my original question (in the first post in this thread): how to store an object in application scope?
Yes. All the JSPs are backed by Spring controllers. And the data is same for all users.

Truly appreciate your time,
Anand
Yeah, I can do that. Didn't strike my mind

Thanks a lot, Nathan.

I still have one question though. If I need to access it in multiple JSP pages, what's the best way to do it? Is it a good idea to set it in session scope in the formBackingObject() or handleRequestInternal()?
Hi,

I want to get some data from the master tables in the database and store them in the application context at app startup.

I created a class named MasterDataLoader and set the DAO object in it using dependency injection. Defined a method named "initialize()" to call the DAO methods to get the data from the database. In the bean declaration in the applicationContext.xml, I gave the init-method as "initialize". So when the app starts it makes the database calls and get the data. I just want to how to store it in application scope.

Also, how to access such an object (in application scope) in a Controller?

Appreciate any help.

Thanks,
Anand
Catalina.out is not being generated by Tomcat. Under tomcat\logs, I find all other logs except Catalina.out. We have Tomcat installed in an Unix box.

Any pointers to possible problems will be greatly appreciated.

Thanks,
Anand
16 years ago