How can I know if a viewScope variable has been in

2019-06-27 03:42发布

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".

1条回答
你好瞎i
2楼-- · 2019-06-27 04:19

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

if (viewScope.containsKey("SomeName")) ...
查看更多
登录 后发表回答