pro_jsp thread: How to handle a null variable in JSP
String flag="";
if (flag==null || flag.equals("")) { //try && also, depending on the
context.
//do something
}else{
//do something else
}
> How to handle a null variable in JSP.
>
> for ex:-
>
> String flag;
>
> i want to perform an action if it is null and
> another action if it is not null.
>
> can i check like this:- if (flag==null)
> if(flag!=null)
>
> sometimes it works fine and othertimes it doesn\'t
> work.
>
> what is the reason and the solution.
|





