hi I use this code: ExternalContex contex = FacesContex.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest)context.getRequest();
and then : String title = request.getParameter("title");
but title is null.
Maybe I must use another method of getCurrentInstance(). please help me!
Josh Juneau
Ranch Hand
Joined: Jun 16, 2004
Posts: 86
posted
0
Try to request the parameter map instead of references to the HTTP session. Look at this topic below. It pertains to a commandLink, but it should also work for a commandButton. I hope this solves your issue...good luck!
f:param is only handled by h:commandLink. Per the spec, the commandButton doesn't perform any actions with respect to h:param.
Arnav Jain
Greenhorn
Joined: Oct 26, 2010
Posts: 1
posted
0
Just another way of doing this using a4j:
----------xhtml code------------------------
<a4j:form>
<a4j:commandButton action="#{TestPage.testMethod}" value="Submit">
<f:param name="title" value="TestValue" />
</a4j:commandButton>
</a4j:form>
Though its an old post, just adding my comments if it could help someone looking for same stuff.
Srinivasan thoyyeti
Ranch Hand
Joined: Feb 15, 2007
Posts: 557
posted
0
Arnav Jain,
You saved my day !!!
Thanks & Regards,<br />T.Srinivasan,<br />SCWCD 1.4(89%),SCJP 5.0(75%)<br />"That service is the noblest which is rendered for its own sake." - Mahatma Gandhi
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.