omnifaces

Show an InputStream as dynamic image in JSF

試著忘記壹切 提交于 2019-11-28 05:54:05
问题 How can we embed and show an InputStream as dynamic image in JSF 2.0 with OmniFaces? 回答1: 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

<partial-response> XML shown as plain text after ajax redirect on security constraint in WildFly

狂风中的少年 提交于 2019-11-28 01:59:11
I've got this weird problem with ajax redirect on a security constraint: When an ajax call is made (by clicking on a sortable p:dataTable column or when a p:poll triggers) on a role-secured page after my session timed out, a <partial-response><redirect-url=... XML from OmniFaces is shown on the screen. When I remove OmniFaces, the ajax calls seem to fail silently and I don't get the XML shown. Security is configured as following in web.xml: <security-constraint> <web-resource-collection> <web-resource-name>Pages</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth

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

别等时光非礼了梦想. 提交于 2019-11-28 01:19:52
问题 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? 回答1: You need to check in the required attribute if the other inputs have submitted a non-empty value. Since this can result in

Why FullAjaxExceptionHandler does not simply perform an ExternalContext#redirect()?

社会主义新天地 提交于 2019-11-27 23:15:09
In OmniFaces, the FullAjaxExceptionHandler , after having found the right error page to use, calls the JSF runtime to build the view and render it instead of the page that includes the AJAX call. Why this? IMHO it would be simpler to just perform a ExternalContext#redirect() ? Are there specific reasons to do this? We are writing our own ExceptionHandler based on FullAjaxExceptionHandler and wanted to understand the reason behind this design. BalusC The primary goal of the FullAjaxExceptionHandler is to let exceptions during ajax requests to behave exactly the same as exceptions during non

How to correctly use OmniFaces in an EAR

你说的曾经没有我的故事 提交于 2019-11-27 08:04:19
问题 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

Server side HTML sanitizer/cleanup for JSF

主宰稳场 提交于 2019-11-27 05:38:21
Is there any HTML sanitizer or cleanup methods available in any JSF utilities kit or libraries like PrimeFaces/OmniFaces? I need to sanitize HTML input by user via p:editor and display safe HTML output using escape="true" , following the stackexchange style. Before displaying the HTML I'm thinking to store sanitized input data to the database, so that it is ready to safe use with escape="true" and XSS is not a danger. BalusC In order to achieve that, you basically need a standalone HTML parser . HTML parsing is rather complex and the task and responsibility of that is beyond the scope of JSF,

Why FullAjaxExceptionHandler does not simply perform an ExternalContext#redirect()?

别来无恙 提交于 2019-11-26 21:22:11
问题 In OmniFaces, the FullAjaxExceptionHandler, after having found the right error page to use, calls the JSF runtime to build the view and render it instead of the page that includes the AJAX call. Why this? IMHO it would be simpler to just perform a ExternalContext#redirect() ? Are there specific reasons to do this? We are writing our own ExceptionHandler based on FullAjaxExceptionHandler and wanted to understand the reason behind this design. 回答1: The primary goal of the

java.lang.AbstractMethodError: org.apache.xerces.dom.ElementImpl.getTextContent()Ljava/lang/String

ぃ、小莉子 提交于 2019-11-26 17:03:49
问题 I'm using Omnifaces 1.3 + Primefaces 3.4.1 + Jboss 7.1.1 Final but I just can't redirect the exceptions with the FullAjaxExceptionHandler configured on my web.xml when they come by ajax request. Nothing happens, just an another exception: 19:38:05,467 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/taxMileage].[Faces Servlet]] (http--0.0.0.0-8181-4) Servlet.service() for servlet Faces Servlet threw exception: java.lang.AbstractMethodError: org.apache.xerces.dom

Server side HTML sanitizer/cleanup for JSF

◇◆丶佛笑我妖孽 提交于 2019-11-26 11:39:33
问题 Is there any HTML sanitizer or cleanup methods available in any JSF utilities kit or libraries like PrimeFaces/OmniFaces? I need to sanitize HTML input by user via p:editor and display safe HTML output using escape=\"true\" , following the stackexchange style. Before displaying the HTML I\'m thinking to store sanitized input data to the database, so that it is ready to safe use with escape=\"true\" and XSS is not a danger. 回答1: In order to achieve that, you basically need a standalone HTML

Pass an object between @ViewScoped beans without using GET params

情到浓时终转凉″ 提交于 2019-11-26 10:29:25
I have a browse.xhtml where I browse a list of cars and I want to view the details of the car in details.xhtml when a "View more" button is pressed. Their backing beans are @ViewScoped and are called BrowseBean and DetailsBean , respectively. Now, I wouldn't like the user/client to see the car ID in the URL, so I would like to avoid using GET params, as presented here and here . Is there any way to achieve this? I'm using Mojarra 2.2.8 with PrimeFaces 5 and OmniFaces 1.8.1. BalusC Depends on whether you're sending a redirect or merely navigating. If you're sending a redirect, then put it in