jsf-2.2

CDI beans injection

不想你离开。 提交于 2020-01-21 19:14:30
问题 Is this a correct approach to inject @ApplicationScoped bean in @SessionScoped bean? will this lead my application scoped bean to be stored in the session of every user? I have an application scoped bean that contains some values we share among all the system users, and now I need to get that values within a method in a session bean. 回答1: Injecting a bean of the same or a broader scope in another bean is completely legal and correct either in JSF or CDI beans, like the example you provided.

Using the page event with p:dataList in PrimeFaces

安稳与你 提交于 2020-01-21 05:50:09
问题 Does a <p:dataList> support the page event? I'm trying to use the page event in the following way (blocking a <p:dataList> using <pe:blockUI> while going through pages). <pe:blockUI target="dataList" widgetVar="blockDataListUIWidget"> <h:panelGrid columns="2"> <h:graphicImage library="default" name="images/ajax-loader1.gif"/> <h:outputText value="Fetching..." class="block-ui-text"/> </h:panelGrid> </pe:blockUI> <p:dataList id="dataList" var="orderRow" value="#{orderDetailsManagedBean}" first=

Invalid URL Pattern When Deploying To Glassfish 4.1

…衆ロ難τιáo~ 提交于 2020-01-14 17:01:12
问题 I had a web filter to redirect from the login and index page if the user was already authenticated. Originally I had an invalid URL pattern. I fixed the invalid pattern and attempted to redeploy only to receive this: java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}] at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136) I checked around in my application to see if I was missing something or had typed something else wrong

Wildfly 10 issue with css file

三世轮回 提交于 2020-01-11 09:16:32
问题 <h:outputStylesheet library="test/css" name="style.css" /> Above code is not working in wildfly 10 with jar file jsf-impl-2.2.12-jbossorg-2 . Issue getting is: WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-6) JSF1064: Unable to find or serve resource, style.css, from library, test/css. Can anyone help on this ? 回答1: The value of a library attribute should not be a path but a reference to a single folder (grouping css ,js etc.) and a direct descendant of the

Invoking a JavaScript function from oncomplete handler of p:remoteCommand - simulating the same using some JavaScript code

偶尔善良 提交于 2020-01-11 01:46:28
问题 Caution : Although this question covers long textual information with a mess of Java code snippets, it is merely targeted to JavaScript/jQuery and a bit of PrimeFaces stuff (just <p:remoteCommand>) as mentioned in the introductory part in the beginning. I am receiving a JSON message from WebSockets (Java EE 7 / JSR 356 WebSocket API) as follows. if (window.WebSocket) { var ws = new WebSocket("wss://localhost:8181/ContextPath/AdminPush"); ws.onmessage = function (event) { jsonMsg=event.data;

Implications of saving session on the client with javax.faces.STATE_SAVING_METHOD

偶尔善良 提交于 2020-01-10 20:12:14
问题 My first JSF page was throwing javax.faces.application.ViewExpiredException . while I searched I got this solution which solved my problem. <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> But I am concerned about the security implication. 回答1: This doesn't save the "session" in client side at all. This only saves the JSF view state in client side. This is in JSF 2.2 always AES-encrypted with a key which is generated

Implications of saving session on the client with javax.faces.STATE_SAVING_METHOD

99封情书 提交于 2020-01-10 20:10:35
问题 My first JSF page was throwing javax.faces.application.ViewExpiredException . while I searched I got this solution which solved my problem. <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> But I am concerned about the security implication. 回答1: This doesn't save the "session" in client side at all. This only saves the JSF view state in client side. This is in JSF 2.2 always AES-encrypted with a key which is generated

Include dynamic content containing JSF tags/components from stream

╄→尐↘猪︶ㄣ 提交于 2020-01-09 03:52:05
问题 I am working on an application where I would like to include dynamic XHTML content from a stream. To handle this I wrote a taghandler extension which dumps the dynamic XHTML content to output component as UIOutput htmlChild = (UIOutput) ctx.getFacesContext().getApplication().createComponent(UIOutput.COMPONENT_TYPE); htmlChild.setValue(new String(outputStream.toByteArray(), "utf-8")); This works fine for XHTML content which has no JSF tags. If I have JSF tags in my dynamic XHTML content like

Target Unreachable, identifier 'user' resolved to null

流过昼夜 提交于 2020-01-07 09:50:28
问题 So I have this very weird issue... I have tried searching all over StackOverflow and tried everything I could find, but I simply cannot fix this error from happening. The error is: /index.xhtml @15,60 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null It's a school project and the project works for some of my classmates, but it also won't work for some. Could it be NetBeans screwing up when we open them? So far at least 2 people got it working, but at least 2 people

Downloading files from outside of the application [duplicate]

不问归期 提交于 2020-01-07 09:24:42
问题 This question already has answers here : how to download image from any web page in java (6 answers) Closed 2 years ago . I'm using jsf 2.2 Primefaces 6.0 and i already implemented a solution to download an images from the ressources file inside the application and it works fine but when i try to download from the outside an error message will appear.I need help to can download from the outside of the application: Here the error message : Context Path:/gestion-remboursement-web Servlet Path: