Hi, does Servoy execute or run a method like onApplicationStartup at initial startup of solution in Application Server? I need to initialize a HashMap before the Servoy application is ready to be used by clients/users.
Hi Erik,
You could use a batch processor (i.e. headless client) for this that launches once, does it’s thing and quits (all by your own code).
Hope this helps.
ROCLASI:
Hi Erik,You could use a batch processor (i.e. headless client) for this that launches once, does it’s thing and quits (all by your own code).
Hope this helps.
Thanks for the reply. So how does this work? I’d like to start a headless client automatically when I start the application server. Will I set the headless client through the web.xml like the code below?
<servlet>
<servlet-name>ExecutionServlet</servlet-name>
<servlet-class>com.x.ExecutionServlet</servlet-class>
<init-param>
<param-name>startHeadlessClient</param-name>
<param-value>1</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
Hi Erik,
You don’t have to dig into any config files. Instead you go to the Servoy-admin pages and in the Batchprocessors page you can create a new batchprocessor. At the top of this page you tell Servoy to load these batchprocessors when the server starts (or not).
Hope this helps.
Thanks for the quick reply.
Can I access a variable such as a HashMap in a Headless client from Servoy smart client (sc) or web client (wc)? I’d like to retrieve some details from a Headless client at startup and share these information to sc and wc.
Erik,
If you want to share data between clients you can do that via a table.
If you want this only in memory, you could create a plugin that does this, but this requires some java programming.
Your plugin would need a server and a client part to work in SC as well.
plugins.static.setValue(key, value)
plugins.static.getValue(key)
Rob
rgansevles:
Erik,If you want to share data between clients you can do that via a table.
If you want this only in memory, you could create a plugin that does this, but this requires some java programming.
Your plugin would need a server and a client part to work in SC as well.plugins.static.setValue(key, value)
plugins.static.getValue(key)
Rob
Thanks Rob. I know Java/JEE programming. Do you have a tutorial for creating server-side plugins? I read the client part already.
You can also use our UserManager plugin. It already includes client and/or server HashMaps neatly wrapped in a JSHashMap.