convert To String from JSF Html Input Hidden - Java JSF

Java examples for JSF:HtmlInputHidden

Description

convert To String 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 String convertToStr(HtmlInputHidden hi) {
        String str = null;/*from w w  w . j a  v a  2  s  . c om*/
        if (hi != null) {
            str = (String) hi.getValue();
        }
        if (str != null && !str.trim().equals("")) {
            return str;
        }
        return null;
    }
}

Related Tutorials