1

For a JavaFX application which connects to a rest web service to function, are there any obvious strategies for building a single version of your application which knows which server environment (QA/Prod) to connect to? How is this type of thing "typically" done? Are separate QA and Production builds recommended?

Obviously, you'd want to make it easy for users to hit production without hassles, but also prevent your testers from accidentally interacting with production instead of QA.

This would be for a web-start JavaFX application, so while ideally the binaries would be identical, the main difference is the server the application came from (which web-start page they logged into initially to initiate their server side session).

User
  • 293
  • 3
  • 19

1 Answers1

2

If you are using JNLP-files, you might wan't to add some start-parameter on-the-fly, which controlls the targeted system. You could implement some download-page, where you adjust the parameters inside the JNLP-file, but this does not prohibit users from using the wrong downloaded JNLP-file.

Why not making it possible to select the server inside some settings, locked behind some "I want to be part of BETA-testing"-flag?

This question is not really JavaFX-related, more a general thing i guess ;)

FibreFoX
  • 2,858
  • 1
  • 19
  • 41
  • Yes it's probably more about Java Web Start, it also applies to Swing and so on, true. Server selection (for testers) is what I thought I would have to resort to, but it'd be nice if it were automatic. Going to look into JNLP with start parameters. – User Oct 24 '16 at 06:12
  • What was meant by "start parameters" on the fly here? Modifying a jnlp file before it's served to a user's PC? Or is there some way to pass values "into" the jnlp configuration dynamically (like how you'd do it with a JSP)? In particular it would be nice if we could specify a dynamic "codebase", href values for icons, and so on so that it always hits the server the jnlp was hosted on instead of some hard coded url. – Manius Aug 09 '17 at 19:10
  • Based on this question, it seems it may be possible to omit "codebase" entirely. Still not sure about the hrefs for icons and such (maybe just make it a relative path?), but it's something to look into at least. https://stackoverflow.com/questions/8388360/java-how-to-get-ip-address-automaticallly-in-jnlp-file – Manius Aug 09 '17 at 19:47
  • @Crusader the JNLP-file is a static readable textfile, it is XML which can be modified by hand/by the download-page. Thats what i meant by "on-the-fly". – FibreFoX Aug 10 '17 at 06:35