Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know if a viewScope variable has been initialized

In an application I need to know if a viewScope variable has been initialized. When the viewScope variable is created the value might be null. So viewScope.isEmpty("SomeName") does not tell me that it has been intialized and the answer is null or it has not been initialized yet. None of the viewScope properties seem to answer the question "dose the viewScope exist".

like image 416
Bill F Avatar asked Dec 09 '22 10:12

Bill F


1 Answers

You can get the information whether a viewScope variable does exist or not with

if (viewScope.containsKey("SomeName")) ...
like image 188
Knut Herrmann Avatar answered Mar 23 '23 08:03

Knut Herrmann