Link to home
Start Free TrialLog in
Avatar of ayha1999
ayha1999

asked on

Retrieve input value from JSF page

I am trying to retrive input text of the textboxes from a jsf page but nothing returns. what is wrong with the code?

<h:form id="myForm">
<h:inputText size="10" id="txtName"/>

    public void printValue() {
        HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        String txtName = request.getParameter("myForm:txtName");
        System.out.println(txtName);
    }

ayha
ASKER CERTIFIED SOLUTION
Avatar of Mark Bullock
Mark Bullock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial