jsf

confirmDialog commandButton does not redirect/ does nothing if you wait for a longer period of time/ idle time session

梦想的初衷 提交于 2020-04-17 20:06:13
问题 I have a JSF page where a popup would appear if he is idle for some period of time. 3 min 10 min etc If he is idle for some period of time a confirmDialog box would comeup with a message - "Your session has expired." and a command button id="quitConfirm" OK Upon clicking the button ID it redirects to the home page or what ever path that you mentioned To test this I deployed this in my local weblogic server and after a wait time of 4 min or so clicked on the commandButton OK it redirected as

confirmDialog commandButton does not redirect/ does nothing if you wait for a longer period of time/ idle time session

一个人想着一个人 提交于 2020-04-17 20:06:11
问题 I have a JSF page where a popup would appear if he is idle for some period of time. 3 min 10 min etc If he is idle for some period of time a confirmDialog box would comeup with a message - "Your session has expired." and a command button id="quitConfirm" OK Upon clicking the button ID it redirects to the home page or what ever path that you mentioned To test this I deployed this in my local weblogic server and after a wait time of 4 min or so clicked on the commandButton OK it redirected as

jsf dynamic tag from string

∥☆過路亽.° 提交于 2020-04-16 06:25:33
问题 i want to show some data to the user the data maybe represented to user by different JSF tags based on a configuration for example some times it may represented by text and sometimes it may represented by graphical symbol or even chart also i want that this representation be customizable. how could i do this? 回答1: Make use of the rendered attribute. <h:outputText value="#{bean.value}" rendered="#{bean.datatype == 'text'}" /> <h:graphicImage value="#{bean.value}" rendered="#{bean.datatype ==

Adding filterBy to p:dataTable causes java.lang.NullPointerException at javax.faces.component.StateHolderSaver.<init> on postback

纵饮孤独 提交于 2020-04-13 03:50:26
问题 I'm trying to develop a datatable with lazy loading. Unfiltered and filtered records are correctly loaded from the persistence context through the use of UserService (i.e. a simple DAO). I'm 100% sure the problem is not related to the DAO being used because it has been successfully tested and deployed in other packages. The error comes out when I try to insert a filter: the collection of filtered items is correctly loaded on the page but it looks like at the end of the process something goes

Adding filterBy to p:dataTable causes java.lang.NullPointerException at javax.faces.component.StateHolderSaver.<init> on postback

六月ゝ 毕业季﹏ 提交于 2020-04-13 03:48:13
问题 I'm trying to develop a datatable with lazy loading. Unfiltered and filtered records are correctly loaded from the persistence context through the use of UserService (i.e. a simple DAO). I'm 100% sure the problem is not related to the DAO being used because it has been successfully tested and deployed in other packages. The error comes out when I try to insert a filter: the collection of filtered items is correctly loaded on the page but it looks like at the end of the process something goes

Opening a new window if condition true in managed bean

廉价感情. 提交于 2020-04-11 10:56:30
问题 I want to implement a situation where the user enter a URL, and if a specified condition is true in my managed bean this URL will be opened in a new web page. I found this possibility: The “h:link” tag is useful to generate a link which requires to interact with the JSF “outcome” , but lack of “action” support make it hard to generate a dynamic outcome. The “h:commandLink” tag is suck, the generated JavaScript is really scary! Not recommend to use this tag, unless you have a solid reason to

Perform page navigation after a file download

爱⌒轻易说出口 提交于 2020-04-05 15:29:06
问题 I need to find a way to perform a page navigation after generating a file download. So far, I've got the file download ready and working: FileInputStream stream = new FileInputStream(file); FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); ec.responseReset(); ec.setResponseContentType("application/octet-stream"); ec.setResponseHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); OutputStream out = ec

JSF: reloading page via p:button using “?includeViewParams=true” results in %2C for integer GET param in new URL

我与影子孤独终老i 提交于 2020-03-25 13:51:36
问题 I have a page that has two GET params: round = [some integer] group = [some string] See URL above. These are the two components of the group's PK, an INT + a VARCHAR. Facelet code: <f:metadata> <f:viewParam name="round" value="#{groupHandler.roundId}"> <f:convertNumber integerOnly="true" /> </f:viewParam> <f:viewParam name="group" value="#{groupHandler.groupCode}" /> <f:viewAction action="#{groupHandler.loadEntity}" /> </f:metadata> ... <p:button widgetVar="reloadPageButton" value="Reload

JSF: reloading page via p:button using “?includeViewParams=true” results in %2C for integer GET param in new URL

懵懂的女人 提交于 2020-03-25 13:49:11
问题 I have a page that has two GET params: round = [some integer] group = [some string] See URL above. These are the two components of the group's PK, an INT + a VARCHAR. Facelet code: <f:metadata> <f:viewParam name="round" value="#{groupHandler.roundId}"> <f:convertNumber integerOnly="true" /> </f:viewParam> <f:viewParam name="group" value="#{groupHandler.groupCode}" /> <f:viewAction action="#{groupHandler.loadEntity}" /> </f:metadata> ... <p:button widgetVar="reloadPageButton" value="Reload

架构师内功心法,参与电商订单业务开发的状态模式详解

只愿长相守 提交于 2020-03-21 14:47:40
3 月,跳不动了?>>> 状态模式在生活场景中也是比较常见的。比如我们平时网购的订单状态变化,还有平时坐电梯,电梯状态的变化。 在软件开发过程中,对于某一项的操作,可能存在不同的情况。通常处理多情况问题最直接的办法就是使用if...else或者switch...case条件语句进行判断。这种做法对于复杂状态的判断天然存在弊端:判断条件语句过于臃肿,可读性较差,不具备扩展性,维度难度也很大。如果转换一下思维,将这些不同状态独立起来用各种不同的类进行表示,系统处理哪种情况,直接使用相应的状态类进行处理,消除条件判断语句,代码也更加具有层次感,且具备良好的扩展能力。 状态模式(State Pattern)也成为状态机模式(State Machine Pattern),是允许对象在内部状态发生改变时改变它的行为,对象看起来好像修改了它的类。状态模式中类的行为是由状态决定的,不同的状态下有不同的行为。其意图是让一个对象在其内部改变的时候,其行为也随之改变。状态模式的核心就是状态与行为绑定,不同的状态对应不同的行为。 一、状态模式的应用场景 状态模式适用于以下几种场景: 行为随状态改变而改变场景; 一个操作中含有庞大的多分支机构,并且这些分支取决于对象的状态。 状态模式主要包含三种角色: 环境类角色(Context):定义客户端需要的接囗,内部维护一个当前状态实例,并负责具体状态的切换;