Once the application is
configured, all the buttons are shown as normal, and divGettingStarted is hidden. Because
we determine whether the app has been configured by getting an OptionsDTO object, which
has a field configured that will be set to true or false accordingly, we need this to execute on
the server. It actually could have been another Ajax call to the server, but I felt this was a
much simpler and cleaner way to do it. The trend in recent years has been to move away from
scriptlets in JSPs, and I generally agree with that trend. However, I don??™t take it to the extreme
of suggesting it should never be done, and in a case like this I felt it was acceptable, and probably
even more desirable because the alternative is something like a custom tag, which seems
like overkill, or else an extra Ajax call as I mentioned. With the extra call, you have to make
sure the UI is not accessible to the user for the duration of the call; otherwise, the user could
be performing functions that really should be disabled, and which would be disabled as a
result of the Ajax call. The KISS principle is something I adhere to, and this seems like a good
example of following that principle.
Pages:
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276