view-scope

JSF without @ViewScoped

孤人 提交于 2020-06-08 04:14:19
问题 I've been using JSF for many years and in the next project we're aiming to make the web-tier as stateless as possible. One possibility I'm exploring is removing @ViewScoped beans in favour of @RequestScoped (plus one or two @SessionScoped beans as required). This is proving troublesome for complex pages with AJAX, datatables and conditional rendering. My question is: how well does JSF (and PrimeFaces) work with stateless web beans? Is this something that I should continue to explore, or is

Viewscoped JSF and CDI bean

廉价感情. 提交于 2020-01-23 05:42:25
问题 I'm using Java EE 6 on JBoss EAP 6, and my JSF beans are annotated like this: @ManagedBean @ViewScoped (both from javax.faces.bean package) However, they are also CDI beans (default constructor, use of @Inject , @PreDestroy etc). I'm reading all the time that you can't mix these annotations (JSF and CDI), but it's apparently working fine: Injections are working, preDestroy is called on view change etc). Am I missing something? What is the problem? Why not use? 回答1: The CDI @Inject works

How to loop and get the values from all the components in a repeat when saving

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 19:48:28
问题 I have a XPage with a repeat control getting its values from a viewScope vector. <xp:repeat id="repeat1" rows="100" indexVar="i" value="#{javascript:viewScope.v1}" </xp:repeat> The fields are binded to the vector like this <xp:inputText value="#{viewScope.v3[i]}" id="qty" style="width:80px"</xp:inputText> I have managed to get the update correctly by using the onChange event on the input boxes. something like this. <xp:eventHandler event="onchange" submit="true" refreshMode="partial"

Are ViewScoped beans serialized to the page when client state saving is turned on?

六月ゝ 毕业季﹏ 提交于 2020-01-01 05:04:31
问题 We have client state saving turned on and use ViewScoped backing beans. When client state saving is turned on and we are using a ViewScoped bean, is the ViewScoped bean serialzied to the page or is it say, stored in session with a token/key that is serialized to the page (so that the page can recall the bean from session if the page is posted-back to itself) A concern here might be that, if it is serialized, then we might want to then worry about not storing large instance variables on the

Linked ViewScoped beans lead to memory leaks

[亡魂溺海] 提交于 2019-12-30 03:13:29
问题 In our JavaEE6 project (EJB3, JSF2) on JBoss 7.1.1, it seems we have a memory leak with @ViewScoped beans. Last tree days I've spent time on this issue investigation. So i've created simple project with two pages to guarantee that after first page leaving @ViewScoped bean will be released. <context-param> //web.xml <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name

JSF View scope in Spring

筅森魡賤 提交于 2019-12-28 02:04:45
问题 Is there any scope like JSF @ViewScoped in Spring 3.0? I have an application using JSF+Spring where backing beans are managed by Spring. I didn't find any scope like JSF wiew scope in Spring. I saw the blog Porting JSF 2.0’s ViewScope to Spring 3.0, but it didn't work for me. Here's my attempt on the custom Spring scope: import java.util.Map; import javax.faces.context.FacesContext; import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.config.Scope;

Pass an object between @ViewScoped beans without using GET params

纵然是瞬间 提交于 2019-12-27 10:30:28
问题 I have a browse.xhtml where I browse a list of cars and I want to view the details of the car in details.xhtml when a "View more" button is pressed. Their backing beans are @ViewScoped and are called BrowseBean and DetailsBean , respectively. Now, I wouldn't like the user/client to see the car ID in the URL, so I would like to avoid using GET params, as presented here and here. Is there any way to achieve this? I'm using Mojarra 2.2.8 with PrimeFaces 5 and OmniFaces 1.8.1. 回答1: Depends on

Pass an object between @ViewScoped beans without using GET params

好久不见. 提交于 2019-12-27 10:30:09
问题 I have a browse.xhtml where I browse a list of cars and I want to view the details of the car in details.xhtml when a "View more" button is pressed. Their backing beans are @ViewScoped and are called BrowseBean and DetailsBean , respectively. Now, I wouldn't like the user/client to see the car ID in the URL, so I would like to avoid using GET params, as presented here and here. Is there any way to achieve this? I'm using Mojarra 2.2.8 with PrimeFaces 5 and OmniFaces 1.8.1. 回答1: Depends on

Pass an object between @ViewScoped beans without using GET params

筅森魡賤 提交于 2019-12-27 10:29:20
问题 I have a browse.xhtml where I browse a list of cars and I want to view the details of the car in details.xhtml when a "View more" button is pressed. Their backing beans are @ViewScoped and are called BrowseBean and DetailsBean , respectively. Now, I wouldn't like the user/client to see the car ID in the URL, so I would like to avoid using GET params, as presented here and here. Is there any way to achieve this? I'm using Mojarra 2.2.8 with PrimeFaces 5 and OmniFaces 1.8.1. 回答1: Depends on

p:fileUpload inside p:dialog losing @ViewScoped values [duplicate]

元气小坏坏 提交于 2019-12-25 16:24:46
问题 This question already has answers here : p:commandbutton action doesn't work inside p:dialog (4 answers) Closed 3 years ago . I'm trying to update multiple files with <p:fileUpload> . After I upload the files, I set a List with the paths that works fine. After that the user then has to fill some other optional information and then click on a button(to submit the form). When the user clicks on the button all the information about the list that was done on the public void handleFileUpload