Thursday, February 26, 2009

How to get in JSF url parameters

How to get in JSF url parameters

lets consider the following example:
http://mysuperapp.com/appname?mygetparam=program1
http://mysuperapp.com/appname?mygetparam=program2
http://mysuperapp.com/appname?mygetparam=program3

Bind GET parameters to your backing bean. (Just putting them in the url is cludgy)

All you have to do is use the param object in your el expression:


myBean
com.mysuperapp.MyBean
request

myPropery
#{param.mygetparam}



Now your request scope backing bean has the value from the url.

0 comments: