Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » [NEON] Hot Swapping UI changes made in Java
[NEON] Hot Swapping UI changes made in Java [message #1755760] Tue, 07 March 2017 16:14 Go to next message
Nick Payne is currently offline Nick PayneFriend
Messages: 3
Registered: February 2017
Junior Member
Hello there!

We currently need to restart the UI server after making changes in the Java Code before we can see the change in the browser, even though the code has been successfully hot swapped on the server (both Jetty and Tomcat, using JRebel). We'd be able to save a lot of time if we could skip the server restart.

I assume this is due to some sort of caching mechanism; the views are usually not recreated even if the underlying Java class has changed. Is there some way to change this?

We have noticed that setting scout.dev.mode=true allows us to see changes in JS and CSS files after a refresh (without a server restart), however this does not seem to apply to changes made in Java classes.

Any clues are appreciated!

Cheers, Nick
Re: [NEON] Hot Swapping UI changes made in Java [message #1755821 is a reply to message #1755760] Wed, 08 March 2017 12:44 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
It's important to understand that the Html UI part of Scout only renders the current state of the Java model that exists in the Scout client on the UI server. Typically a Scout developer works with getConfigured* methods to define properties in the Scout model. These getConfigured* methods are only called in the initConfig() method, which is called by the constructor of a Scout object. This means when you add a new getConfigured* method to a field in a Form, this will have no effect on an existing instance of that Form (even when your VM can handle hot code swapping).

However, you could change the _properties_ of a Scout object directly in the Java Debugger and then perform a reload in the browser. Basically initConfig does the same thing: it reads the value returned by getConfigured* and then sets the according property via a setter method.

When you work with forms the simple solution is to close the current form and open the form again, which will create a new instance and call all getConfigured* methods.

Some Scout objects (like outlines) are only instantiated one time for each ClientSession. In that case you can simply kill the current session, either programatically or by calling the /logout URL. When you login again (or call the start URL of your Scout app) you'll get a new ClientSession and also new instances of your outlines.




Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:[neon] Problems with server unit test -> @BeforeClass called too late
Next Topic:[neon] Supplying a desktop when unit testing forms
Goto Forum:
  


Current Time: Thu Apr 25 22:27:53 GMT 2024

Powered by FUDForum. Page generated in 0.03365 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top