omnifaces

Can I use omnifaces generic converter in primefaces autocomplete component?

北战南征 提交于 2019-12-01 18:10:31
I am trying to use Omnifaces generic Converter in Primefaces autocomplete component Like this : <p:dataTable id="transactiondetailsid" value="# {stockTransactionsBean.stkTransHeader.stkTransDetailsList}" var="stkTransDet" rowIndexVar="rowIndex"> <p:column> <f:facet name="header"> <h:outputText value="Item Code" /> </f:facet> <p:autoComplete id="dd" dropdown="true" autocomplete="true" value="#{stkTransDet.item}" var="i" itemLabel="#{i.itemnamee}" itemValue="#{i}" converter="omnifaces.SelectItemsConverter" completeMethod="#{stockTransactionsBean.completeItems}" forceSelection="true" scrollHeight

How to create a thumbnail link to OmniFaces graphicImage method

风格不统一 提交于 2019-12-01 08:21:08
问题 I was wondering if and how it is possible to display an <o:graphicImage> as thumbnail inside a <p:lightbox> . To be more precise, I wanted to achieve something like this: <p:dataTable id="articles" var="article" value="#{articleMB.articles}" selectionMode="single" rowKey="#{articles.id}" selection="#{articleMB.selectedArticle}"> <p:column> <p:lightBox styleClass="imagebox" id="lighbox"> <h:outputLink value="#{imageBean.getFirstImage(article, true)}"> <o:graphicImage value="#{imageBean

Spring Security/JSF/Hibernate Accidental Session Hijacking on Tomcat?

纵然是瞬间 提交于 2019-12-01 04:48:48
Something very strange and embarrassing happened to me the other day and I don't have words to describe what happened. My app runs Spring 3 integrated with JSF 2.1, Hibernate 4, Spring Security all on Tomcat 7. I was over the phone with someone important from C-level and we were both simultaneously on the test environment at the same time on the same pages. He went to navigate to a page that I was navigating to at pretty much the same moment when his page came up with my personal account details. I didn't believe him, so I walked over to his office and sure enough, he somehow was logged on as

Spring Security/JSF/Hibernate Accidental Session Hijacking on Tomcat?

主宰稳场 提交于 2019-11-30 05:39:22
问题 Something very strange and embarrassing happened to me the other day and I don't have words to describe what happened. My app runs Spring 3 integrated with JSF 2.1, Hibernate 4, Spring Security all on Tomcat 7. I was over the phone with someone important from C-level and we were both simultaneously on the test environment at the same time on the same pages. He went to navigate to a page that I was navigating to at pretty much the same moment when his page came up with my personal account

Show an InputStream as dynamic image in JSF

不羁的心 提交于 2019-11-29 12:19:50
How can we embed and show an InputStream as dynamic image in JSF 2.0 with OmniFaces? BalusC OmniFaces does not offer any utility for this — yet. If the image files are located on the disk file system, then you need to create a virtual context in the servletcontainer configuration so that they can be accessed by a normal URL. See also Load images from outside of webapps / webcontext / deploy folder using <h:graphicImage> or <img> tag . If the image files are stored in the DB, then you need to create a simple servlet which just writes the InputStream of the image from the DB to the OutputStream

Navigate to a different page in preRenderViewEvent depending on user permission; ExternalContext#dispatch() does not work

☆樱花仙子☆ 提交于 2019-11-29 11:56:38
The page should be rendered only if user has permissions to see it. I try to achieve that by performing a check in PreRenderView event listener method: <f:event type="preRenderView" listener="#{theBean.init}" /> And the method itself: public void init() { if (user.havePermission()) { // backing bean init } else { FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); ec.getRequestMap().put("message", no_permissions_message); try { ec.dispatch(ec.getRequestContextPath() + path_to_no_perm_page); fc.responseComlete(); } catch (IOException e) { e

Validate a group of fields as required when at least one of them is filled

不羁的心 提交于 2019-11-29 07:48:50
In a basic registration screen (with button register records the screen) there are two panels: Data panel: Address panel: I can register by completing only the Data panel. It is not necessary to fill the Address panel. However, if at least one field of the Address panel is filled, then all other fields in the same panel should be required. How can I achieve this? You need to check in the required attribute if the other inputs have submitted a non-empty value. Since this can result in quite some boilerplate, here's a kickoff example with only 3 input components. <h:form id="form"> <h:inputText

How to correctly use OmniFaces in an EAR

巧了我就是萌 提交于 2019-11-28 14:04:45
I want to use OmniFaces 1.7 in my Jave EE 7 application. My application is an EAR that contains JARs and a skinny WAR . Some of my JARs have a dependency to OmniFaces, so the OmniFaces artifact must be in the EAR but not in WEB-INF/lib in the WAR. Here is how my EAR looks like: EAR +-- lib | +-- [some 3rd party JARs] | `-- omnifaces.jar +-- myEJBs.jar `-- myWAR.war When I put it this way, OmniFaces converters (like GenericEnumConverter ) are not registered with JSF and won't work. The reason for this is discussed here and here . Basically according to the JSF 2.0 Spec (section 11.5.1

FullAjaxExceptionHandler does not show session expired error page on ajax button

做~自己de王妃 提交于 2019-11-28 11:42:12
I have implemented Omnifaces FullAjaxExceptionHandler but the problem is It is not working with ajax requests. After session expires when I click to non-ajax button, It works well. It redirects user to custom error page. But if the button uses ajax, It doesn't do anything. Page just stucks. Edit: I have changed ActionListener to Action and still same. Edit2: It gives no error. Neither Apache Tomcat output nor Apache Tomcat Log. here is my spring security; <http auto-config='true' use-expressions="true"> <intercept-url pattern="/login" access="permitAll"/> <intercept-url pattern="/ajaxErrorPage

JSF: Mojarra vs. OmniFaces @ViewScoped: @PreDestroy called but bean can't be garbage collected

柔情痞子 提交于 2019-11-28 10:33:54
This question is specific to the OmniFaces @ViewScoped bean (however of interest to wider discussion about memory leakage and resource disposal with JSF @ViewScoped). It is based on the results of this NetBeans8.1 test web app available on GitHub: Investigation of undesirable holding of references to various forms of JSF @ViewScoped beans by navigation type https://github.com/webelcomau/JSFviewScopedNav That test web app has a comprehensive README with complete instructions, as well as annotated test web pages comparing obsolete JSF2.0-style @ManagedBean @ViewScoped , JSF2.2-style CDI-friendly