flash-scope

After post is setting a value in JSF2 flash scope, it is visible again on second GET request to a page (Flash scope considered harmful)

陌路散爱 提交于 2020-01-14 14:43:07
问题 I tested new Flash scope in JSF2 but I found a major issue with it or I am lacking some knowledge. Having a page: <h:body> Value in flash: #{flash.text} <h:form> <h:inputText value="#{flash.text}" /> <h:commandButton value="Test" /> <!-- Same behavior with faces redirect --> </h:form> </h:body> I have a scenario: Put a value 'foo' and click Test I get 'Value in flash: foo' I open new page with the same adress I get 'Value in flash:' I open another new page with the same adress I get 'Value in

Can the Flash data be persisted after redirection?

只谈情不闲聊 提交于 2020-01-06 02:45:13
问题 Using JSF 2.1.29 In list.xhtml <p:commandLink id="ownerViewLinkId" value="#{petOwner.firstName} #{petOwner.lastName} " action="#{ownerAndPetListBean.viewPetOwnerFrmList(petOwner.id,petOwner.userId,0)}" onclick="PF('progrees_db').show()" oncomplete="PF('progrees_db').hide()" style="color:#0080FF;"> </p:commandLink> In listBean (viewscoped), public void viewPetOwnerFrmList(String ownerIdStr, String userIdStr, String petIdStr) { try { FacesContext.getCurrentInstance().getExternalContext()

set Flash.keepMessage to true in JSF 2 configuration file is possible?

醉酒当歌 提交于 2019-12-25 08:02:47
问题 This line: FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true); Can be changed by another code in any configuration files? I want to avoid typing this line whenever I need to redirect from code whit this line: FacesContext.getCurrentInstance().getExternalContext().redirect("errorApp"); Regards. 回答1: There is no configuration setting to change the "keep messages" feature. Just create an utility method which replaces the repeated code by a single method call.

Getting warning from JSF: The response was already committed by the time we tried to set the outgoing cookie for the flash

荒凉一梦 提交于 2019-12-17 17:57:56
问题 I have a page1.jsf, in this page i have a commandButton that put an object in ELFlash, and redirects to page2.jsf. In this page i recover the object by ELFlash. Everything works fine. But while the user remains in page2.jsf, for every ajax request, tomcat shows this warning message: 20/07/2013 09:43:37 com.sun.faces.context.flash.ELFlash setCookie WARNING: JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash. Any values stored to the flash

JSF Flash Scope remembers too many messages

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 12:12:10
问题 I have a simple flow in my appliaction - if you fill out and press save on one form (if everything goes well) you are redirected to a second view with a list. Now I wanted to add a message saying "You successfuly added an object" but since I'm using a redirect from what I remember I need to use the Flash scope. And so I did. The problem is that during the first "save" it correctly shows only 1 message but when I navigate back to the form and hit "save" it will show me the current message and

java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading [duplicate]

最后都变了- 提交于 2019-12-08 18:41:43
问题 This question already has answers here : *.xhtml url-pattern causes java.lang.NullPointerException at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForReading (2 answers) Closed 4 years ago . I am running my application in apache-tomcat-7.0.16 using JSF-2.1.2. After adding navigation rules in faces-config.xml, I am getting the NullPointerException. This bug was filed in JSF forum. Is there any compatible version between JSF and the tomcat app server or any solution for this? Error

Mojarra 2.1.14 flash scope messages and redirect to different path

安稳与你 提交于 2019-12-08 01:22:44
问题 According to this: http://java.net/jira/browse/JAVASERVERFACES-2136 flash-"scoped" messages should survive a redirect to a page on a different path.. I wanted to use something like this in my application so i downloaded javax.faces-2.1.14-20121003.074348-10 snapshot from here https://maven.java.net/content/repositories/snapshots/org/glassfish/javax.faces/2.1.14-SNAPSHOT/ to test. My situation is this: I have a page (call it test.xhtml) in the root directory that in the view-scoped backing

Warning JSF1095 while using a h:commandLink inside a rich:dataTable

試著忘記壹切 提交于 2019-12-06 13:20:34
问题 I have a h:commandLink inside rich:dataTable . When I click on the command link, I'm adding a FacesMessage to the context and redirecting to the same message. I have a h:messages tag on the page to display any faces messages. I am able to display the message, but I'm getting following warning and the messages are not getting cleared. WARNING: JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash. Any values stored to the flash will not be

Mojarra 2.1.14 flash scope messages and redirect to different path

流过昼夜 提交于 2019-12-06 10:17:54
According to this: http://java.net/jira/browse/JAVASERVERFACES-2136 flash-"scoped" messages should survive a redirect to a page on a different path.. I wanted to use something like this in my application so i downloaded javax.faces-2.1.14-20121003.074348-10 snapshot from here https://maven.java.net/content/repositories/snapshots/org/glassfish/javax.faces/2.1.14-SNAPSHOT/ to test. My situation is this: I have a page (call it test.xhtml) in the root directory that in the view-scoped backing bean during the call of the constructor does a check and conditionally sets a message using Omnifaces

Warning JSF1095 while using a h:commandLink inside a rich:dataTable

孤街醉人 提交于 2019-12-04 18:43:14
I have a h:commandLink inside rich:dataTable . When I click on the command link, I'm adding a FacesMessage to the context and redirecting to the same message. I have a h:messages tag on the page to display any faces messages. I am able to display the message, but I'm getting following warning and the messages are not getting cleared. WARNING: JSF1095: The response was already committed by the time we tried to set the outgoing cookie for the flash. Any values stored to the flash will not be available on the next request. I am using JSF2.0, RF4.0.0.Final. Following is the code index.xhtml <?xml