B4J Question Building web servers with B4J how create global variables

Roberto P.

Well-Known Member
Licensed User
Longtime User
HI
how to create global variables in the web server? user code and other information to be saved for each transaction.
thanks
 

avacondios

Active Member
Licensed User
Longtime User
You can create a global Hashmap variable and store any information for each session or to share any information on each request. Unfortunately, we don't have the possibility to create listeners on Jetty server and it will be good idea to add on the next version of B4x. Be careful, the variables need to be thread safe, because each handler is running on different thread and you cannot modify on the same time a common global variable.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top