Two Laptop Bag
The moose likes JSF and the fly likes UI:Param Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "UI:Param " Watch "UI:Param " New topic


chiranjeevi gunturu
Ranch Hand

Joined: Mar 02, 2007
Posts: 59
I am trying to understand a some part of code in my project and came across a syntax which i dont know.

I have the following line of code in one xhtml file. the syntax given for value is not clear to me.

can some one help me here?
Rafael Cechinel Silvestri

Joined: Oct 04, 2012
Posts: 1

Hi chiranjeevi gunturu
Your code is too vague. You can post a more complete code?

Anyway i'll try explain the code above.

the first code sent a parameter name "sample" and string value "$SAMPLE$". The target where the value is set depends the more complete code.

the second code print the value of parameter name "sample" to html view. The value can be in request, session or application scope.

it would be like invoke a url through the GET method like this "http://url/index.jsf?sample=$SAMPLE$"
in your Servlet class you can retrive parameter like this

I hope I helped you

Rafael Cechinel Silvestri
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

"$SAMPLE$" looks like the kind of thing that a template processor would use to reference replaceable variables. However, JSF already has a template processor (EL), so this is a little strange.

In any event. any use of "ui:param" or other code-like constructs in a JSF View Definition (xhtml) should be a very rare occasion. The View Definition is supposed to be a template for the display. Logic should be located in the backing beans. Parameter passing between the two is usually not required because JSF has implicit mechanisms to handle such things.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: UI:Param
It's not a secret anymore!