view-scope

WELD-001303 No active contexts for scope type javax.faces.view.ViewScoped

落花浮王杯 提交于 2019-12-03 21:45:41
I have switched to javax.enterprise.context.SessionScoped to javax.faces.view.ViewScoped Upgraded faces 2.1 to 2.2 to be able to use ViewScoped with my CDI injections. After I switched to ViewScoped I have started getting this error and I can't figure out why! Do you think there is something wrong here? Glassfish 3.1.2, Primefaces 3.4.2, JSF 2.2 org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.view.ViewScoped The button opens the page: The jsf page; <h:form enctype="multipart/form-data"> <p:fieldset legend="Create new feed" toggleable=

Destroying view-scoped beans when session ends

Deadly 提交于 2019-12-03 20:10:31
My question is related to this one (and probably others): @PreDestroy never called on @ViewScoped As stated there, there's no trivial solution to either have view-scoped beans destroyed upon navigation and the same seems to hold true for when the session expires. What would a non-trivial approach to release (calling the @PreDestroy method) JSF view-scoped beans look like, or more specifically as soon as the session expires? I'm using Java EE 6 and Mojarra 2.1.x on GlassFish 3.1.2. Create a @SessionScoped bean to hold the resources (in some collection/array?) and inject it in the @ViewScoped

Is rich:fileUpload component in (RC 4.3.4) working on Apache Tomcat7 and JSF 2.2 ? : “Request prolog cannot be read”

大憨熊 提交于 2019-12-03 13:53:11
问题 I'm trying to upload a file with richfaces fileupload component. My bean is in a viewscoped. My code extracted from the showcase. <rich:fileUpload id="upload" immediateUpload="true" fileUploadListener="#{analyse.listener}" acceptedTypes="png" ontyperejected="alert('Seulement les fichiers avec l'extension bam et pdf sont acceptés.');" maxFilesQuantity="3"> <a4j:ajax event="uploadcomplete" execute="@none" /> </rich:fileUpload> The bean function called : public void listener(FileUploadEvent

How to survive viewscoped beans/viewmap after session destroy (using client side saving)?

℡╲_俬逩灬. 提交于 2019-12-02 21:52:28
问题 I'm using Myfaces 2.2 with Client-side state saving . I see that the ViewScoped beans & data stored in viewmap is lost after the user session is destroyed. I came to know, not sure if it is correct, that this is the expected behavior but then what's the way to avoid view expired exceptions after session destroy? My problem is that I destroy the user session pretty quickly after some inactivity period(like after 20 minutes) but I want the viewscope data to survive even after that(when using

How to survive viewscoped beans/viewmap after session destroy (using client side saving)?

半世苍凉 提交于 2019-12-02 07:47:43
I'm using Myfaces 2.2 with Client-side state saving . I see that the ViewScoped beans & data stored in viewmap is lost after the user session is destroyed. I came to know, not sure if it is correct, that this is the expected behavior but then what's the way to avoid view expired exceptions after session destroy? My problem is that I destroy the user session pretty quickly after some inactivity period(like after 20 minutes) but I want the viewscope data to survive even after that(when using client saving) so that when the user comes back after session destroy, he doesn't need to do a page

View scope: java.io.NotSerializableException: javax.faces.component.html.HtmlInputText

試著忘記壹切 提交于 2019-12-02 06:09:50
问题 There is an error each time a button calls an action from the backing-bean. Only applies to beans with a view scope and I haven't found a way to fix it without regression over other modules in the code. DefaultFacele E Exiting serializeView - Could not serialize state: javax.faces.component.html.HtmlInputText java.io.NotSerializableException: javax.faces.component.html.HtmlInputText at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) Or also: com.ibm.ws.webcontainer

View scope: java.io.NotSerializableException: javax.faces.component.html.HtmlInputText

心已入冬 提交于 2019-12-02 01:51:55
There is an error each time a button calls an action from the backing-bean. Only applies to beans with a view scope and I haven't found a way to fix it without regression over other modules in the code. DefaultFacele E Exiting serializeView - Could not serialize state: javax.faces.component.html.HtmlInputText java.io.NotSerializableException: javax.faces.component.html.HtmlInputText at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) Or also: com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause Faces Servlet:

Memory implications of OmniFaces ViewScoped bean?

蓝咒 提交于 2019-12-01 22:29:22
From what I understand, ViewScoped beans only get destroyed when one of the following take place: 1) JSF sends a POST request to another page with something like a <h:commandLink...> 2) The number of open beans exceeds the maximum threshold setting (default of 15) 3) The user's session expires Here is my confusion: Does #1 mean that if a user navigates away from the page with a GET request, the bean will stay open, even if eventually a JSF POST happens in the same browser tab on another page? Or will all active @ViewScoped instances for that browser tab be destroyed once a JSF POST is sent

How to put data in view scope via EL in JSF page

橙三吉。 提交于 2019-12-01 11:07:33
In my JSF page this works: ${requestScope.put('test', 'data')} ${requestScope.get('test')} This causes exception: ${viewScope.put('test', 'data')} ${viewScope.get('test')} Exception: java.lang.NullPointerException javax.el.BeanELResolver.invoke(BeanELResolver.java:159) javax.el.CompositeELResolver.invoke(CompositeELResolver.java:84) org.apache.el.parser.AstValue.getValue(AstValue.java:157) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:238) com.sun.faces.facelets.el.ELText$ELTextComposite.writeText

Multiple browser tabs or windows with the same ViewScoped bean class

你离开我真会死。 提交于 2019-12-01 08:20:41
问题 Using Payara Server 4.1.2.174 with mojarra 2.2.15. I have a simple Named Bean with scope javax.faces.view.ViewScoped. import java.io.Serializable; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.PostConstruct; import javax.faces.view.ViewScoped; import javax.inject.Named; @Named @ViewScoped public class SimpleBean implements Serializable { private final Logger logger = Logger.getLogger(SimpleBean.class.getName()); @PostConstruct private void init() {