convert To Long from JSF Html Input Hidden - Java JSF

Java examples for JSF:HtmlInputHidden

Description

convert To Long from JSF Html Input Hidden

Demo Code


import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.faces.component.html.HtmlInputHidden;

public class Main{
    public static Long convertToLong(HtmlInputHidden hi) {
        Long str = null;//from ww w .  ja  va 2s.  com
        if (hi != null) {
            str = (Long) hi.getValue();
        }
        //      if (str != null && !str.trim().equals("")){
        //         return Long.parseLong(str);
        //      }
        return str;
    }
}

Related Tutorials