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]