This question already has answers here:
Integrating JSTL With Facelets
(2 answers)
Internationalization in JSF, when to use message-bundle and resource-bundle?
(1 answer)
Localization in JSF, how to remember selected locale per session instead of per request/view
(5 answers)
JSTL in JSF2 Facelets... makes sense?
(3 answers)
Closed 5 years ago.
I tried to use jsf .properites bundle, but it does not work in my case.
<fmt:setLocale value="ru"/>
<fmt:setBundle basename="text"/>
<fmt:message key="test"/>
Message not showing.
In application server log no any related messages.
text.properties and text_ru.properties content:
test = 123
My project structure:
Related
This question already has an answer here:
How can I access session attribute in Facelets page
(1 answer)
Closed 5 years ago.
I am trying to write some code in jsf scriptlet to get a attribute from HttpSession and compare with a UI value (to display a pop-up when both session and UI values are same ) .
You can do it in JSF with EL: #{session.getAttribute('key') eq uiValue}.
List of all JSF EL objects can be found here.
This question already has answers here:
Conditionally displaying JSF components
(3 answers)
Closed 6 years ago.
I wanna add this action.
If EL is 'true' like this, #{trueFalseBean.isTrue}, I wanna pop up message without pressing any button like 'onload();', otherwise no action. How can I use if, else clause on JSF or PF? Please help me thanks
Define a boolean variable in your bean and set it with a method when an action is started. Then use variable last situation to make something.
This question already has answers here:
Localization in JSF, how to remember selected locale per session instead of per request/view
(5 answers)
Closed 6 years ago.
I have set up internationalizing in my web page,however, language button toggles by it self after clicking different menu on the menubar. I want to display one language in whole web page unless user changes to a different language.I looked for post related to this but couldn't get one.
Any link, idea or book recommendation would be highly appreciated.
Thanks
tag is needed before the beginning of the and tag before closing tag in JSF and PrimeFaces.This is needed only in Facelets Template file and not needed in Facelets Template Client file.
This question already has answers here:
ViewParam vs #ManagedProperty(value = "#{param.id}")
(2 answers)
Closed 8 years ago.
At what point is a field using #ManagedProperty annotation set?
Specifically, does it happen during construction or after construction?
Any field using #ManagedProperty annotation is set immediately after the constructor runs. So the same field can be used in a #PostConstruct method. That is what my main concern was while asking this question. For more lucid details please refer to the following excellent post https://stackoverflow.com/a/4889226/1391249
This question already has answers here:
back commandbutton in jsf
(5 answers)
Closed 8 years ago.
How do I make a link which navigates the user back one page (i.e. same as clicking browser back)?
Thanks.
To the point: just remember the request URL or the JSF viewId of the previous page so that you can use it in the href or value of the output/commandlink. There are several ways to achieve it, depending on how you're actually navigating through the pages and how "jsfish" you want to achieve it. You could pass it as a request parameter by f:param in h:outputLink, or you could set it as a bean property by f:setPropertyActionListener in h:commandLink, or you could create a PhaseListener which remembers the viewId and make use of navigation cases, or you could grab the -much less reliable- JavaScript history.go() function.