File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes How to access JSF hidden field value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to access JSF hidden field value? " Watch "How to access JSF hidden field value? " New topic

How to access JSF hidden field value?

Gautam Ry
Ranch Hand

Joined: Dec 30, 2008
Posts: 41
i am very new to JSF. My question
say a form has the following JSF component
<h:inputHidden id= "emp_id_val" value="AX"/>

How can I access the hidden field value using request scope?.

As we know, if the component is as below instead of the above.
<input type="hidden" name="emp_id_val" value="AX"/>
we can use <%=request.getParameter("emp_id_val")%>

I am looking for the similar kind of thing for JSF component.


Brajendra Mathema
Ranch Hand

Joined: Jun 02, 2009
Posts: 39

you can use value=#{requestScope['managed bean in requestscope'].attribute}

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

You could even bind the hidden field to an instance of a JSF HtmlInputHidden and extract it that way, although I prefer the previous posters approach:

-Cameron McKenzie

I agree. Here's the link:
subject: How to access JSF hidden field value?
It's not a secret anymore!