I Flash-Area (I know it's not "scope" like others, but often referred to as JSF 2.0 In the form of one) (Moserra)
My problem is that the flash-cookie is attached to the path of view by placing the object in flash.
As a result the object is unavailable after unavailable in a different way, we need strings (and possibly objects) available on the other side of the redirect-navigation.
I have implemented a In effect this cover will modify Flash-Cookies to force the application reference-route. My question is that I will not be seeing this because of other problems. None of your assumptions are incorrect: The flash-cookie is bound to the path of the view that is in the object in the flash. It turns out that, Flash Scope is exactly the same as the redirect. In other words, the object kept in Flash scope will avoid a redirect. If you are messing with cookies and filters, then you are probably doing something wrong JSF removes those concepts so that you can use only POOs for your work . Do not mess with Java EE cookies, you are going to work a lot more than you need and you can instantly create a very weaker code. To use Flash Scope, hold a reference to it: To put: To get: Will your hacks cause problems with JSF? I will say with definite certainty, if not now, then later when you try the mojorra, then use a different container or switch to the mifs. @WebFilter whose purpose is to override it and replace it with
ServletResponse with the following wrapper.
Private Class ResponseWrapper HttpServletResponseWrapper Extended {Private Final String Path; Public liability (HTSPRate Response Response, String Reference Path) {Super (feedback); This.path = reference path; } @ Override Public Zero addCookie (cookie cookie) {// hardcoded name jsf-effect # com.sun.faces.context.flash.ELFlash last string FLASH_COOKIE_NAME = "csfcfc"; If (cookie.getName (.) Equals (FLASH_COOKIE_NAME)) {cookie.setPath (path); } Super. Edakuki (cookie); }}
I can not understand why Flash should be bound by the way of the scene in the first place.
Flash Flash = FacesContext.getCurrentInstance (). GetExternalContext (). GetFlash ();
Flash. Input ("myObject", myObject);
object myObject = flash.get ("myObject");
Comments
Post a Comment