Check if a variable is defined in java

I need to check if a variable is specified somewhere else in the code upon receipt.

Due to inclusion in the JSP, I sometimes get a variable defined in two places, and then java returns an error. Using jsp: include doesn't work either.

I am looking for something in the form #ifndeffor c, but not in the preprocessor (since it is java) to avoid duplicating the local variable.

I cannot use ==nullor isnull(), because sometimes the variable will not be defined at all, and not just uninitialized

+4
source share
1 answer

, , , , , jsp, , . , , , myfolder/foo.jsp, bar, myfolder_foo_jsp_bar, .

+1

Source: https://habr.com/ru/post/1649787/


All Articles