This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "UI:Param " Watch "UI:Param " New topic
Author

UI:Param

chiranjeevi gunturu
Ranch Hand

Joined: Mar 02, 2007
Posts: 59
Hi,
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
Greenhorn

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


regards,
Rafael Cechinel Silvestri
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

"$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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UI:Param
 
Similar Threads
Simple loop/function in XHTML page
setting value for ID attribute dynamically for rich:modalpanel (for templating overlay)
Data from search not being dynamically added to rich:dataTable
How to used a variable inside the value attribute of a h:inputText tag
Invoking bean from included JSF page