Kathleen Angeles

Ranch Hand
+ Follow
since Aug 06, 2012
Kathleen likes ...
Firefox Browser Spring Tomcat Server
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
9
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kathleen Angeles

How is the ApplicationContext loaded in the application?

Below is an idea.

=======================================================================

1. Define the static data in a Spring singleton bean instead of in a listener.
2. Keeping the Spring singleton bean alive, and never garbage collected:

If the data is for the whole application, then it is better to put the mentioned Spring singleton bean in the root application context of your web application, as compared to a servlet context.

ContextLoaderListener can be used to load the suggested Spring singleton bean, into the root application context.



=======================================================================

This idea above relies on if the root application context Spring container will stay alive during the entire life of the web application, and that the Spring container will never garbage-collect the Spring singleton bean instance in it, while the Spring container is alive.
5 years ago
If the intent is to preload some data to improve system performance or user experience, then it will help to set your cache to never expire.

This can be done also in ehcache using the 'eternal' setting.

- k


----------------------------------------------------------------------------------------
[SpringSource Certified Spring Professional (Spring Certification) - Practice Tests]
[SpringSource Certified Spring Web Application Developer (Spring Certification) - Practice Tests]
5 years ago
Hi fellow ranchers,

Which websites do you visit regularly for i.t. news?
5 years ago
The Spring singleton scope is an implementation of the singleton design pattern.

Everytime you ask the Spring container for a bean that is configured to be in singleton scope, the Spring container will return the same Spring bean instance.

The opposite is the Spring prototype scope.

Bean scopes


- k


----------------------------------------------------------------------------------------
[SpringSource Certified Spring Professional (Spring Certification) - Practice Tests]
6 years ago
And there are no other transactions in that unit flow? In other words, are there other resources involved, that could have caused a rollback, which cascaded to your persist? E.g. you can have 2 datasources, this one succeeded and the other one failed, and since you are using XA, I guess you are capable of multi-resource rollback.

- k


----------------------------------------------------------------------------------------
[SpringSource Certified Spring Professional (Spring Certification) - Practice Tests]
6 years ago
Try using @SessionAttributes.

- k


-----------------------------------------------------------------------------------------------
[SpringSource Certified Spring Professional (Spring Certification) – Practice Tests]
6 years ago
Hi Frank,

If you need the poll1 to be there in between requests, you can use @SessionAttributes.

In your case, you can put something like below.




- k

---------------------------------------------------------------------------------------
[SpringSource Certified Spring Professional (Spring Certification) – Practice Tests]
6 years ago
You can also look at rackspace.com.

A cloud server can be used just like any computer. You can install any java that you want.

- k

=======================================================
[SpringSource Certified Spring Professional (Spring Certification) – Practice Tests]
6 years ago
3 solutions are below.

1. Use onchange attribute of the html select tag (whatever front-end framework you are using) and call the server (e.g. ajax, json, jquery) for the 2 items you need. For efficiency, call only when you need to, i.e. when you actually need those 2 data already.

since you are using spring mvc, adding a jquery/json service is simple. Look into Jackson and jquery.

2. If the list of locations is small, you can load the entire list (e.g. ajax, json, jquery, initial page load, etc.) and do search when needed. This is not scaleable. I do not advise on using this.

3. If you have no other alternatives, this is what I would use. Fast, efficient. No additional server call.

3. a. locString needs to be post-processed because it now contains not just location but also the 2 other fields
3. b. change
itemValue="location"
to
itemValue="locationLatitudeLongitudeDelimitedByBar"

3. c. as implied by #b. above, add a getLocationLatitudeLongitudeDelimitedByBar() method. Use a delimiter (e.g. bar "|") that doesn't occur in your data.

an example of data returned by getLocationLatitudeLongitudeDelimitedByBar() is below.
"NorthPole|010101|38362"

3. d. as you probably have guessed, you need to use onchange attribute of the html select tag or process it only when needed

-k

================================================================
[SpringSource Certified Spring Professional (Spring Certification) – Practice Tests]
6 years ago
Hi Eric,

I also checked the table of contents in Oreilly website. I think the list is great, and this is the book that I really need.

Basically, something like 'enterprise javascript development'.

Is that basically what you were targetting - a book like enterprise development with javascript in the middle?

edit: when i say enterprise, i probably mean all stuff going on in the front-end that involves javascript.
I think your book will be a great material to have. Good luck! (and to me too, hope I win).
Hi All,

Has anyone seen any good book on designing/coding javascript programs?

Having coded in java, I see a lot of places where an error (misspell, type safety, etc.) can occur in javascript, where it wouldnt in java.

E.g. good practices like encapsulating methods or the same encapsulation that objects/classes offer in java.

Hi Elliot,

Has you book touched on this? Or maybe the majority of the book?

Having a lot of power on the front-end, with html 5, etc. the application written in javascript will grow big quickly. Organization is a requirement not just an ideal.


- k