jsf

Invalidate specific jsf bean session

☆樱花仙子☆ 提交于 2020-02-04 23:03:52
问题 How I invalidate a specific bean in a session? I have this example code. I test with ExternalContext.invalidateSession(); but it destroy all beans in the session in the application since it destroys the full session. @Named @SessionScoped class Managed implements Serializable { public void invalidate (){ // lines // externalContext.invalidateSession(); } } but, with invalidateSession all beans in the session are destroyed, I want to invalidate only the one specific "Managed" bean, how I do

Reading and writing a XML file in JSF

一世执手 提交于 2020-02-04 07:34:46
问题 I found nothing online about how to read/write an XML document in JSF. I know something in JSP along with JSTL using XALAN. For example, The following XML file is defined under /WEB-INF . <?xml version="1.0" encoding="UTF-8"?> <fruits> <fruit> <name>Orange</name> <price>10</price> </fruit> <fruit> <name>Banana</name> <price>20</price> </fruit> <fruit> <name>Apple</name> <price>30</price> </fruit> </fruits> This document can be read in JSP like the following. <%@ taglib prefix="c" uri="http:/

Force selection of highlighted p:autoComplete item when panel is hidden by clicking outside

只愿长相守 提交于 2020-02-04 00:42:13
问题 I have a problem (bug?) with my auto-complete. MyFaces 2.2.9 with PrimeFaces 5.1 This below is only an example to reproduce my error. I have a auto-complete - box in my modal dialog. Case 1 : I type something select "hello" from list in autocomplete and submit. Converter gets my person id and search the right person, all works fine. Case 2 (Error 1) : I type "h" and click in my modal area the h stays and list close. (When I submit my form h only disappears, no converter call) But I think h

Force selection of highlighted p:autoComplete item when panel is hidden by clicking outside

只愿长相守 提交于 2020-02-04 00:41:21
问题 I have a problem (bug?) with my auto-complete. MyFaces 2.2.9 with PrimeFaces 5.1 This below is only an example to reproduce my error. I have a auto-complete - box in my modal dialog. Case 1 : I type something select "hello" from list in autocomplete and submit. Converter gets my person id and search the right person, all works fine. Case 2 (Error 1) : I type "h" and click in my modal area the h stays and list close. (When I submit my form h only disappears, no converter call) But I think h

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default

孤者浪人 提交于 2020-02-03 10:16:30
问题 My project was working fine yesterday. The only thing I did was to change the structure from a single war to a multi module pom. If I understand correctly the stacktrace there is ambiguousity between weld and omnifaces websocket lib. However there doesn't seem to be any call to any of my methods on the stacktrace. So maybe it's a problem with omnifaces ? I don't even use omnifaces websockets, I use javax.websocket. I did however try it out in this project in the past, and I did a search on

org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Bean with qualifiers @Default

亡梦爱人 提交于 2020-02-03 10:16:07
问题 My project was working fine yesterday. The only thing I did was to change the structure from a single war to a multi module pom. If I understand correctly the stacktrace there is ambiguousity between weld and omnifaces websocket lib. However there doesn't seem to be any call to any of my methods on the stacktrace. So maybe it's a problem with omnifaces ? I don't even use omnifaces websockets, I use javax.websocket. I did however try it out in this project in the past, and I did a search on

Invalidating session with CDI+JSF not working

末鹿安然 提交于 2020-02-03 09:21:15
问题 I'm trying to implement a logout in my application, so I made this: public String logout(){ try{ FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext ex = facesContext .getExternalContext(); ex.invalidateSession(); return "success"; }catch(Exception e){ return "error"; } } But when I check if the user is logged, it says yes: public class AuthenticateListener implements PhaseListener { @Override public void afterPhase(PhaseEvent event) { AuthorizedUser authorized =

How to Display / Hide jsf components

你。 提交于 2020-02-02 03:22:04
问题 In one of my JSF application, I have header part at the top contains selectOneMenu, and the content part at the bottom which display say, Filter components. By default the application display first selectOneMenu data at the top and corresponding Filter information at the bottom. If the user selects different selectOneMenu data, corresponding Filter information should be loaded on bottom content part. Filter component has CommandButton and user fills Filter information. On click of the button,

Handling Uncaught Exception in JSF

廉价感情. 提交于 2020-01-31 21:57:12
问题 I am developing exception handling framework. The exception handling framework is for a JSF application. The problem I am facing is tracking uncaught exception and displaying a generic message. I am able to handle uncaught exception for the action that are carried out(like on a click of a button), but I am not able to catch uncaught runtime exception at framework level while loading JSF pages or while initializing it. Any help will really be appreciated. Thanks, Prasad 回答1: That depends on

Handling Uncaught Exception in JSF

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-31 21:55:29
问题 I am developing exception handling framework. The exception handling framework is for a JSF application. The problem I am facing is tracking uncaught exception and displaying a generic message. I am able to handle uncaught exception for the action that are carried out(like on a click of a button), but I am not able to catch uncaught runtime exception at framework level while loading JSF pages or while initializing it. Any help will really be appreciated. Thanks, Prasad 回答1: That depends on