jsf-2

PrimeFaces 4.0 FileUpload works with Mojarra 2.2 but not MyFaces 2.2

白昼怎懂夜的黑 提交于 2019-12-20 05:19:25
问题 I am having an interesting problem with the PrimeFaces 4.0 final FileUpload element. I am trying to run: PrimeFaces 4.0 final Apache MyFaces 2.2.0-beta Tomcat 7.0.27 I have a very simple setup right now, XHTML page: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"

“remember me” functionality with jsf 2.0

两盒软妹~` 提交于 2019-12-20 05:15:08
问题 I am trying to implement "remember me"/"autologin" functionality. I have stored a cookie at the client but when should I read it? If I try to do that in a filter, for example, I won't have access to my application-scoped beans which I use to access the db. What are the best practices to do that? 回答1: It depends a little on how your current login exactly works. Is it a container login followed by custom stuff (like putting some object in the session) or only custom? In the first case you can't

ViewScoped works like RequestScoped - why?

梦想的初衷 提交于 2019-12-20 04:55:10
问题 I wrote a ViewScoped Managed-Bean and every time I refresh the page in my webbrowser, the Managed-Bean seems to be recreated, article is null, it loads a new article-object and so on. For me it looks like the same behaviour as RequestScoped. I use Eclipse IDE for Java EE Developers, the newest JDK, Apache Tomcat 7.0.8 and Mojarra 2.0.3. What is wrong? Managed-Bean: ... import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean;

ViewScoped works like RequestScoped - why?

筅森魡賤 提交于 2019-12-20 04:55:02
问题 I wrote a ViewScoped Managed-Bean and every time I refresh the page in my webbrowser, the Managed-Bean seems to be recreated, article is null, it loads a new article-object and so on. For me it looks like the same behaviour as RequestScoped. I use Eclipse IDE for Java EE Developers, the newest JDK, Apache Tomcat 7.0.8 and Mojarra 2.0.3. What is wrong? Managed-Bean: ... import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean;

How to send manual jQuery Ajax request to JSF application?

这一生的挚爱 提交于 2019-12-20 04:39:09
问题 I am doing a POST -request using jQuery which seems to succeed. But how can I work with that on server side and modify the response? Do I need another servlet because the Faces Servlet is just not designed to deal with this? $.ajax({type:'POST', data:{"status":status}, success: function(response) { alert("Qapla'"); }}); It is used for the following process: user inputs address and hits commandButton which invokes JS JS retrieves geodata using google maps and sends it to server (which I am

Want to show a data table populated with data after a button click

ⅰ亾dé卋堺 提交于 2019-12-20 04:26:16
问题 I want to write a code in this way, that If I click on a button a data table appears populated with data. before that there should not be the data table in view. <p:commandButton value="Go" styleClass="apply_button" actionListener="#{searchBean.getUserList}"> <f:attribute name="trigram" value="#{searchBean.trigram}"/> <f:attribute name="firstName" value="#{searchBean.firstName}"/> <f:attribute name="lastName" value="#{searchBean.lastName}"/> </p:commandButton> here the method getUserList()

Pick Custom Object from Select one menu JSF [duplicate]

独自空忆成欢 提交于 2019-12-20 04:23:45
问题 This question already has answers here : How to populate options of h:selectOneMenu from database? (5 answers) Closed 3 years ago . I want to pick a custom object from select one menu. It neither shows an error nor values. What should I do? My xhtml document: <h:panelGrid columns="2"> <p:outputLabel value="" /> <p:selectOneMenu id="CurrencyMenu" value="#{CurrencyMB.currency}" > <f:selectItem itemLabel="-- Select Currency--" itemValue="#{null}"/> <f:selectItems value="#{CurrencyMB.currencyList

JSF 2: page redirect after ajax call

别等时光非礼了梦想. 提交于 2019-12-20 04:11:55
问题 I'm stuck in a navigation case problem similar to this one. In a few words, I'm trying to redirect navigation from one page to another, using an ajax rendered h:commandLink . Here's the backing bean @ManagedBean public class StartBean { public void search(){ FacesContext .getCurrentInstance() .getExternalContext() .getFlash() .put("result", "hooray!") ; } public String showResult(){ return "result?faces-redirect=true"; } } and the starting page <h:body> <h:form prependId="false"> <h

Interval Selection Event in Primefaces Chart

夙愿已清 提交于 2019-12-20 04:06:15
问题 I have a dynamic LineChart. I am setting the zoom to false but I want to be able to trigger an Ajax Event when selecting an area in the Chart (like the zoom functionnality when selecting the area you want to zoom), I want to call a server method and getting the max and min x axis values of the selected area. Can anyone help with this? Else if I set the zoom to true , is there any way to get the values from the zoomed area ? 回答1: PrimeFaces and JSF is in this context nothing more than an html

Url pattern to exclude javax.faces.resource from being invoked by servlet filter

。_饼干妹妹 提交于 2019-12-20 03:54:07
问题 I have created a servlet filter to handle session timeout and authentication. @WebFilter(urlPatterns={"/acc/*"}) public class ResourceAuthorizationFilter implements Filter { ... } The pages that I want to filter have a pattern like this: /acc/login-flow , /acc/profiles-flow . The filter gets called also for resources(css, js and images). How can I configure the urlPatterns to exclude from filtering these resources? EDIT1 Here are some urls that are filtered: http://localhost:8081/acme-0.0.1