FAQ Database Discussion Community


JSF2.2 faces flow method call node

jsf-2.2,faces-flow
I am currently using JSF 2.2 faces flow with WildFly8.2.0 as JAVA EE 7 server. Can anyone has any idea of , how to use/configure method call node using XML file configuration ? I know how to invoke it using FlowBuilder API , but haven't found any tutorial on how...

Call order of h:commandLink action and f:ajax listener

ajax,jsf,jsf-2.2,myfaces
Here is my markup: <h:commandLink value="#{partial}" action="#{hello.setCurrentPartial(partial)}"> <f:ajax render="include" listener="#{hello.renderFragments}"/> </h:commandLink> I tried to run this page in Mojarra-2.2.8(wildfly 8.2.0.Final built-in) and MyFaces-2.2.7(installed as guided here). Surprisingly, when the link is clicked, mojarra calls hello.renderFragments first and then hello.setCurrentPartial, but MyFaces takes the opposite order, i.e., hello.setCurrentPartial is called first....

How to initialize a Part from a String (the file name)?

jsf,file-upload,initialization,jsf-2.2
How do I get my file (javax.servlet.http.Part) from my JSF form? All what I have saved in the database is the file name. Thanks....

Oracle ADF: How to enable a user to Stay Logged In

java,java-ee,jsf-2.2,oracle-adf
I am developing a web application using Oracle ADF. In my web application user has to log in to access web application. Application is working fine. Now I need to enable a feature like once a user has logged In and due to some reasons he closed a tab not...

Using JSF HTML5 friendly markup with other components libraries

html5,primefaces,jsf-2.2
Starting with JSF2.2, it is possible to write more elements in HTML5: writing <button> can be equivalent to writing <h:commandButton>. But how does this work with other components libraries? Is it possible to override that behaviour and let <button> be translated to a component from some library other than the...

How to pass selected column values to a method?

jsf,jsf-2.2
I need your help in passing the selected row columns' values in a <p:dataTable> to a method. Now in my code, I am getting incorrect values and some of them are null, so can you please help. My datatable code is: <p:dataTable id="PendingRequests" var="hr" value="#{hrd.pendingRequests}"> <p:column headerText="Request Date"> <h:outputText value="#{hr.requestDate}"/>...

Target Unreachable, identifier resolved to null

jsf,jsf-2.2
I have a problem with a simple web application in JSF 2.2, my managed bean is not solved and I got this error: /greeting.xhtml @21,66 date="#{dukesBDay.yourBD}": Target Unreachable, identifier 'dukesBDay' resolved to null This is my managed bean: import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; @ManagedBean @SessionScoped public class DukesBDay {...

How can I use annotations instead of XML to create a custom component tag in embedded Tomcat

jsf,annotations,jsf-2.2,custom-component,embedded-tomcat-8
Edit: The only technologies required to reproduce this issue are JSF 2.2 and Spring Boot 1.2.1 + Its embedded Tomcat 8.0.5 server. Everything else listed in this question is just to give context on the tech I'm using. Update #2: Following along with BalusC's thoughts, I ported my sample custom...

When I use o:graphicImage, the image is not displayed

jsf,jsf-2.2,omnifaces,graphicimage
I can´t display images from my database, they are stored as bytea and I am mapping them like this: @Entity @Table(name = "photograph", schema = "public") public class Photograph{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "photograph_id", unique = true, nullable = false) private Long id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name =...

Two JSF libraries providing the same renderer

jsf,jsf-2.2
Short Version: If two JSF library jar files both include a custom renderer for the same family and type, is there any way from within the library itself (i.e. not from the containing app) of specifying which one should be used? Something like assigning a priority, with higher ones used...

javax.servlet.ServletException the request doesn't contain a multipart/form-data or multipart/mixed stream

ajax,jsf,file-upload,jsf-2.2,mojarra
I've the below form which uploads a file via <h:inputFile> and <f:ajax>. <h:form enctype="multipart/form-data"> <h:inputFile id="file" value="#{bean.file}" /> <h:commandButton value="Upload" action="#{bean.upload}"> <f:ajax execute="file" render="file" /> </h:commandButton> </h:form> When I submit it, I get a JavaScript alert with the below error information: serverError: class javax.servlet.ServletException the request doesn't contain a multipart/form-data...

Advantages of using JSF Faces Flow instead of the normal navigation system

jsf,jsf-2.2,faces-flow
I'm exploring the JSF 2.2 Faces Flow feature but I'm still not sure what are the advantages of defining a flow using Faces Flow instead of using the normal navigation system (calling facelets in links or buttons)?

Redirect if a f:viewParam is empty

jsf,redirect,error-handling,jsf-2.2,viewparams
Сan I do a redirect (or error) if a f:viewParam is empty? <f:metadata> <f:viewParam name="accountId" value="#{accountMB.id}"/> </f:metadata> When I add required="true", nothing happens. What are the options?...

JSF Page navigation using rewrite (Need to change browser url for navigation )

jsf,redirect,navigation,jsf-2.2,prettyfaces
I have my RewriteConfiguration class @RewriteConfiguration public class ApplicationConfigurationProvider extends HttpConfigurationProvider { @Override public int priority() { return 0; } @Override /** * map URL with resource */ public Configuration getConfiguration(ServletContext context) { return ConfigurationBuilder.begin() .addRule(Join.path("/page1/{param}").to("/view/page1.jsf?product={param}")) .addRule(Join.path("/page2/{param}").to("/view/page2.jsf?product={param}")) ; } } My managedBean @Named("myBean")...

java.lang.IllegalArgumentException: Multiple entries with same key: interface javax.validation.constraints.Min

jsf,deployment,richfaces,jsf-2.2
I'm running an EAR with EJB + EJB + WAR deployment in JBoss WildFly 8.2.0.Final with JSF 2.2 and RichFaces 4.5.2.Final. My problem is, that all RichFaces resources fail to load properly in the client. The generated URL don't resolve and return with HTTP 404. The deployment is build upon...

JSF Validators do not work if Random or SecureRandom used to generate component ID

jsf,jsf-2.2,mojarra,programmatically-created
When I use UUID#randomUUID() (which uses SecureRandom) or RandomStringUtils#randomAlphabetic(int) (which uses Random) to generate component ID for HtmlInputText validation stops working. If instead I set the component ID using an arbitrary hard-coded String (e.g. "C5d682a6f") the validation works as expected. Here's the code: import org.apache.commons.lang3.RandomStringUtils; import java.util.UUID; import javax.faces.component.html.HtmlInputText; import...

h:outputStylesheet inside ui:repeat

jsf,facelets,jsf-2.2,uirepeat,outputstylesheet
I'm trying to use to output a stylesheet link for every element of an ArrayList. This code produces no result: <ui:repeat value="#{includer.css}" var="ss"> <h:outputStylesheet name="#{ss}" library="css" /> </ui:repeat> However, if i change the Strings in the ArrayList to be full paths and replace h:outputStylesheet with plain html like : <ui:repeat...

visibility of property set in @PostConstruct in ManagedBean

jsf,jsf-2.2,postconstruct
i am tryiing to get property value in my @RequestScoped Bean which is set in @PostConstruct. I have editUser page witch get userId from other page, and i am getting user from database in @PostConstruct, but when i try to edit that user in same page, user object is null,...

If JavaScript enabled submit form, else navigate to view

jsf,jsf-2.2
Is there a JSF-component which a) acts like a h:commandLink if JavaScript is enabled and does a form submit b) acts like a h:link if JavaScript is disabled and simply navigates to a given page? Background: I develop a barrier-free webapplication. The form submit is a convenience function. But users...

JSF Interceptor doesn't fire

cdi,jsf-2.2,interceptor
Why my interceptor doesn't work? MyLog.java @Inherited @InterceptorBinding @Retention(RUNTIME) @Target({METHOD, TYPE}) public @interface MyLog { } MyLogger.java @Interceptor @MyLog @Priority(Interceptor.Priority.APPLICATION) public class MyLogger { @AroundInvoke public Object log(InvocationContext context) throws Exception{ System.out.println("begin " + context.getMethod().getName()); Object obj = context.proceed(); System.out.println("end " + context.getMethod().getName()); return obj; } } PerguntaController.java import interceptor.MyLog;...

Failing to set a default value to the composite component

jsf-2,jsf-2.2,composite-component
I have a List<String> and I successfully represent it in a datatable; now I am trying to create a composite component out of it, but it seems I keep having trouble understanding how StateHelper does work. What I want to do is, if the value attribute passed by xhtml evaluates...

Eclipse + Wildfly + Maven EAR project, is it possible to have files update without redeploy?

eclipse,jsf,jsf-2.2,wildfly-8
I'm working on my first JavaEE/JSF project. It's currently set up with maven so that several jars and a war are deployed inside an EAR container. I spent a lot of time trying to get some kind of hot/autoredeploy type setup going a few weeks ago but gave up and...

File upload via h:inputfile (prettyfaces) does not work

jsf,file-upload,glassfish,jsf-2.2,prettyfaces
I'm trying to upload a file to the glassfish application server (v4.1) via h:inputfile. xhtml-file and bean are prepared as almost every example in the web shows. I tried with and without Pretty Filter in web.xml, allowCasualMultipartParsing in context.xml, and a handful of other possible workarounds. None of them seemed...

FacesContext#getViewRoot() returns null while setting for first time

jsf,locale,jsf-2.2,mojarra
I am trying to change my JSF application locale in one page and that has to change all my pages locale. I have followed this link, and it works well JSF locale is set per request/view, not for session If I run the application I can change the locale in...

PicketLink protection stops JSF 2.2 resource contract from being loaded

jsf-2,jsf-2.2,wildfly,picketlink,resource-contracts
I have a JSF 2.2 webapp with a contract and several pages, located directly in the WebContent folder. The contract consists of an image, a template file template.xhtml and a css file global.css. So far everything is working as expected. Now I want to use PicketLink for user authentication and...

Declaring as passthrough element

jsf,file-upload,jsf-2.2,passthrough-elements
I'm developing in JSF 2.2 using passthrough elements and I would like to translate <h:inputFile> into a passthrough element. I searched in the internet but didn't found any solution using passthrough elements. Which HTML5 should I passthrough to render it?...

Using flows in webfragments

cdi,jsf-2.2,flow-scope
I'm trying to build a webapp that includes a webfragment which contains a flow. I started building a standalone version of the webapp I want to use as a webfragment. That's working. After that I converted it to this structure: flow-webfragment\src\main\java\javaclasses.. flow-webfragment\src\main\resources\META-INF\beans.xml flow-webfragment\src\main\resources\META-INF\faces-config.xml flow-webfragment\src\main\resources\META-INF\web-fragment.xml flow-webfragment\src\main\resources\META-INF\resources\META-INF\context.xml...

Attribute name “p:autofocus” associated with an element type “h:inputText” must be followed by the ' = ' character

html5,jsf,facelets,jsf-2.2,passthrough-attributes
Seems that there is an bug using some HTML 5 attributes using the passthrough namespace, i.e: <h:inputText id="text1" p:autofocus p:placeholder="this is a placeholder text"></h:inputText> When I try to run the page in Glassfish I get this error: Error Parsing /index.xhtml: Error Traced[line: 19] Attribute name "p:autofocus" associated with an element...

Parameters from f:param not submitted with AJAX request when form enctype is multipart/form-data

ajax,jsf,jsf-2,jsf-2.2,wildfly
I'm running Wildfly 8.2 and I'm using the JSF version bundled with it, 2.2.8-jbossorg-1. I have the following facelet: <h:form enctype="multipart/form-data"> <h:commandButton value="Submit"> <f:param name="myparam" value="true"/> <f:ajax execute="@this" render="@this"/> </h:commandButton> </h:form> When I press the submit button, several parameters are submitted, but not myparam. If I remove enctype="multipart/form-data" from the...

Get new instance of session scoped bean with other name

jsf,cdi,jsf-2.2
I have a session scoped bean for a UI to edit some data. It is annotated with @Named and @SessionScoped and all runs in JBoss 6.2. Now I got the requirement for a nearly similar edit UI. The problem is that the two UIs can exist in parallel. So for...

How can I embed an SVG image using JSF/OmniFaces/PrimeFaces?

jsf,jsf-2.2,omnifaces
Here's what I'm trying to do: I have a @ViewScoped JSF bean in which I call a JAX-RS service using Jersey. The resource I'm requesting returns a response with content-type image/svg+xml. Display it in a Facelet page. My research so far has lead me to believe: * h:graphicImage (Core JSF)...

Is it possible to use tag to link self in JSF?

jsf,jsf-2.2
What is the proper value of outcome attribute of tag <h:link> to reference the current page (the page the tag h:link is written in)? Following rules for return values of action methods i tried outcome="" outcome="#{null}" outcome="#{''}" but all of them ends up with error message This link is disabled...

h:commandButton action method is not invoked [duplicate]

jsf,jsf-2.2
This question already has an answer here: commandLink/commandButton/ajax backing bean action/listener method not invoked 7 answers I have the below button: <h:commandButton value="Download" action="#{listFiles.downloadFile}" /> And the below action method: public void downloadFile() { // Some code. } But when I press the button nothing happens. The action method...

called again on first AJAX request [duplicate]

jsf,jsf-2.2,viewparams
This question already has an answer here: Process f:viewParam only on page load 1 answer I'm using JBoss Wildfly 8.2.0 and noticed that <f:viewParam> is called twice on my page: The first time is when I access my page with the given param in the URL The second time...

How to retain a variable when page expires

jsf-2.2
Hi have a variable stored on the session which contains information on which stylesheet to use. When the session times out I want to retain the same stylesheet on the "sessionExpired" page. How is the best way to do this?...

SessionScoped Managed bean injection is not working [duplicate]

jsf,dependency-injection,cdi,jsf-2.2,managed-bean
This question already has an answer here: NullPointerException while trying to access @Inject bean in constructor 1 answer This is my SessionScoped managed bean : import javax.enterprise.context.SessionScoped; import javax.inject.Named; @Named("clientSessionBean") @SessionScoped public class ClientSessionManagedBean implements Serializable { ... } This is my requestscoped managed bean import javax.enterprise.context.RequestScoped; import javax.inject.Inject;...

how to reload p:dataGrid programmatically?

jsf,primefaces,jsf-2.2
I have a datagrid with subscribe and unsubscribe option so the user can subscribe and unsubscribe and vise verse. now I want to reload the datagrid after subscription or unsubscription I load the data of the grid like that @PostConstruct public void init() { packages = packagehelper.getAllPackages(); getCurrentUserSubscritions(); } and...

Converter for JSF passthrough input element (“HTML5 friendly markup”)

jsf,converter,jsf-2.2,passthrough-elements
I'm using a passthrough element inside Facelet page like this: <input jsf:value="#{...}"/> And I'd like to attach a Converter to it. How can I achieve this?...

@FacesComponent on shared library

jsf,java-ee,websphere,jsf-2.2
I'm trying to use a custom jsf component on Websphere 8.5. The component class is annotated with @FacesComponent. The component is on a shared lib jar on the server. I already have an faces-config inside the jar META-INF folder. If the jar is inside my ear file it works as...

PrimeFaces paginator selection

jsf,primefaces,jsf-2.2
I have a PrimeFaces (5) DataTable and like to store the page size selection in the view, so that the user sees the same number of rows when he returns to the view. But all I see from documentation is that there is a page event which can be captured,...

Render hidden elements using JSF and AJAX

ajax,jsf,jsf-2.2
I've been facing some problems using JSF with AJAX to render a table without reloading the whole page every time I submit a form. When I first run the server, my database is empty, so the page is supposed to show only a form to add books. When user submits...

f:viewAction ignored, when commandButton navigates to page

jsf,tomcat7,jsf-2.2
I have a problem with the JSF 2.2 Feature <f:viewAction action="#{...}/>. I placed this tag in my XHTML-Page, it's called viewActionStart.xhtml: <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head /> <h:body> <f:view> <f:metadata> <f:viewAction action="#{redirect.getView()}" onPostback="true"...

How to get previous URL in JSF using FacesContext?

jsf,jsf-2.2
I need to get the redirected URL or id in JSF using FacesContext. For current URL, I'm using. String currentPage = FacesContext.getCurrentInstance().getViewRoot().getViewId(); ...

Instance variable increment in bean on button click JSF 2.2

java,xhtml,increment,jsf-2.2,instance-variables
My xhtml file has a command button as so :- <h:commandButton id="routeAddButton" action="#{routeStatic.add_new_route}" value="Add New Route" /> I am trying to control the visibilty of panelGrids using a boolean array. <h:panelGrid id="route1Grid" columns="2" rendered="#{routeStatic.rendered[0]}" > likewise <h:panelGrid id="route2Grid" columns="2" rendered="#{routeStatic.rendered[1]}" > and so on. On each button click I am...

Submit form without attached file

jsf,jsf-2.2
I want to create JSF form with attached file. But also to give a option form the users to submit the for without attach file. I don't want this to be mandatory. <h:form id="form" enctype="multipart/form-data"> <div class="string"> <label class="name"> <h:inputText id="name" value="#{contacts.name}" pt:placeholder="Name*:"/> </label> </div> <label class="message"> <h:inputTextarea value="#{contacts.comment}" pt:placeholder="Comment*:"/>...

java.lang.NoSuchMethodError: javax.faces.component.UIComponent.getPassThroughAttributes(Z)Ljava/util/Map; after migrating to JSF 2.2

jsf,migration,jsf-2.2,nosuchmethoderror
I am getting the below exception after migrating to JSF 2.2. Specifically, I'm upgrading Mojarra 2.1.17 to Mojarra 2.2.8. java.lang.NoSuchMethodError: javax.faces.component.UIComponent.getPassThroughAttributes(Z)Ljava/util/Map; at org.primefaces.renderkit.RendererUtils.renderPassThroughAttributes(RendererUtils.java:79) at org.primefaces.renderkit.CoreRenderer.renderDynamicPassThruAttributes(CoreRenderer.java:119) at org.primefaces.renderkit.CoreRenderer.renderPassThruAttributes(CoreRenderer.java:114) at...

Datepicker is lost after a callback

javascript,jquery,datepicker,jsf-2.2
I've got this code to generate my datepicker: <script> $(function() { $(".datepicker").datepicker({ showOn : 'button', buttonImage : '../resources/images/calendar.png', buttonImageOnly : true, buttonText : 'Pick a date', onSelect : function() { } }); }); </script> Every time there is a postback, I loose all my calendars. I am working with JAVA...

JSF NumberFormatException with f:setPropertyActionListener

jsf,datatable,el,jsf-2.2,setpropertyactionlistener
I'm getting this error with f:setPropertyActionListener and i can't figure out why: HTTP Status 500 - For input string: "selectedItem" exception: javax.servlet.ServletException: For input string: "selectedItem" javax.faces.webapp.FacesServlet.service(FacesServlet.java:667) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause: java.lang.NumberFormatException: For input string: "selectedItem" java.lang.NumberFormatException.forInputString(Unknown Source) java.lang.Integer.parseInt(Unknown Source)...

Installing Apache MyFaces 2 on WildFly 8.2.0

jsf-2.2,wildfly-8,myfaces
I want to add apache myfaces 2.2.7 in WildFly 8.2.0 and use it as default implementation. Can anybode please let me know where can I found installer jar for apache myfaces ? I am following the link https://developer.jboss.org/wiki/StepsToAddMyFacesSupportToWildFly to add MyFaces support to WildFly. As I understand correctly, I need...

Can't Access session scoped JSF managed bean in web filter

jsf,servlet-filters,jsf-2.2
I have a JSF 2.2 application with login page I need to control users access to the pages so I wrote a web filter but the problem is that it always return null when I try to access the session scoped JSF managed bean. I already logged in and I...

Primefaces Datatable (date column) Filter by calendar

primefaces,jsf-2.2
I am using PF 5.1. I want to filter Primefaces datatable (date column) by calendar set primefaces calendar here . Is it possible ? -Please help anybody ....

Primefaces datatable and ViewScoped

primefaces,jsf-2.2,view-scope
I'm using primefaces 5.0 on wildfly 8.2.0 (mojarra 2.2.8). I tried to use a simple primefaces datatable with expansion but each time I expand a row, my backed bean @PostConstruct is triggered (which reloads the data which nullifies the use of @ViewScoped in the first place). I've seen other questions...

Primefaces SelectBooleanCheckbox gets unchecked on form submission

jsf,primefaces,jsf-2.2
I am new to this Website My issue is related to SelectBooleanCheckbox in primefaces. Whenever I submit my form, the checkbox gets unchecked. I am using dynamic tabview. Here is my xhtml code:- <h:form id="form" > <p:panel id="tagsPanel" > <p:tabView id="tabView" style="background-color:transparent;background-image:none;" var="tabKey" value="#{MBean.Names}" dynamic="true" > <p:dataGrid var="appSettingsList" value="#{appSettingsMBean.tabData[tabKey]}" columns="1"...

update text box based on checkbox selection jquery

javascript,jquery,html,checkbox,jsf-2.2
I want to achieve following thing with Jquery There are multiple trips and each trip has checkbox and textbox. Whenever checkbox is checked then the value in textbox corresponding to that checkbox must be updated to "1" . Whenever customer types in textbox then checkbox shall be checked <input type="checkbox"...

JBoss Wildfly - Authentication of Web App against LDAP

authentication,ldap,jboss7.x,jsf-2.2,wildfly
I have a security domain defined in jboss-web.xml as below <jboss-web> <security-domain>java:/jaas/my_ldap_security_domain</security-domain> <disable-audit>true</disable-audit> </jboss-web> I also have defined inside my standalone.xml <subsystem xmlns="urn:jboss:domain:security:1.2"> <security-domains> <security-domain name="my_ldap_security_domain" cache-type="default"> <authentication> <login-module code="LdapExtended" flag="sufficient"> <module-option...

Handling TagAttributeException and change ui:includeSrc

validation,jsf,facelets,jsf-2.2,uiinclude
We have dynamic menu items in a page and the links for include-source .xhtml stored in the DB, in this scenario if source xhtml is wrongly input or failed to find the application context it throws TagAttributeException with Invalid Path message. After this event, if we make any ajax request...

Selecting a SelectOneMenu populated with enum only after second click

primefaces,enums,jsf-2.2
I'm trying to use enums to populate a PrimeFaces selectOneMenu, but could not get the selected value. After the first click, the value assigned is always the one in the post-constructor. HTML: <p:selectOneMenu id="periodo" value="#{dashboardMB.enumDate}"> <f:selectItems value="#{dashboardMB.enumDates}" var="enumDate" itemValue="#{enumDate}" itemLabel="#{enumDate.label}" /> </p:selectOneMenu> Backing bean: private EnumDate enumDate; @PostConstruct public void...

Reusing ViewState value in other session (CSRF)

jsf-2,viewstate,jsf-2.2,myfaces
I'm using a *myfaces-api-2.2.3 with javax.faces.STATE_SAVING_METHOD set to client , I got the following scenario, 1) User X logs into the system and adds user XXX (using jsf f:ajax action) , while inspecting the chorme dev tools you can see the form that being submitted along with the ViewState value....

How to bind a bean's method with package in actionListener?

jsf,el,jsf-2.2,methodexpression
I am pretty much newbie to Java/JSF technology and I've been trying to do simple UIs to understand how things are going on in Java/JSF world. Now I want to bind a ManagedBean's method with its package name to a CommandButton's actionListener. Example: index.xhtml ... <h:commandButton actionListener="#{com.acme.myclass.MyMethod}" ... ... MyClass.java...

How to deactivate a JSF tag (Primefaces)

jsf,primefaces,jsf-2.2,blacklist
I use Primefaces 5.x (on myFaces 2.2.x) for my UI and I want to disable / deactivate some JSF tags like to avoid mistakes. Is there a blacklist or whitelist I can use?...

@ResourceDependency with string query

jsf,resources,java-ee-6,jsf-2.2,mojarra
I want to implement cache busting via string query with the file version, but I also want to use @ResourceDependency. So this is what I have: @ResourceDependency(name = "scrypt.js?v=version", library = "mylib", target = "head") I know mojarra had trouble with string queries before for the <f:outputScript>, but this has...

pretty faces does not work

jsf,jsf-2.2,myfaces,prettyfaces
I tried pretty faces with my jsf app.URL has not changed.I followed the steps mentioned on the site. pom.xml <dependency> <groupId>org.ocpsoft.rewrite</groupId> <artifactId>rewrite-servlet</artifactId> <version>2.0.12.Final</version> </dependency> <dependency> <groupId>org.ocpsoft.rewrite</groupId> <artifactId>rewrite-config-prettyfaces</artifactId> <version>2.0.12.Final</version> </dependency> I added pretty-config.xml in WEB-INF/...

o:graphicImage throws java.lang.IllegalArgumentException: argument type mismatch

jsf,jsf-2.2,omnifaces,graphicimage
I can´t display images from my database, they are stored as bytea and I am mapping them like this: @Entity @Table(name = "photograph", schema = "public") public class Photograph{ private PhotographId id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "diagnostic_id", nullable = false, insertable = false, updatable = false) private Diagnostic diagnostic;...

Target Unreachable, identifier 'flowScope' resolved to null

jsf,jsf-2.2,faces-flow
I'm exploring the Faces Flow feature in JSF 2.2 and I'm getting the following error Target Unreachable, identifier 'flowScope' resolved to null when I run the tutorial in this page: http://www.mastertheboss.com/javaee/jsf/faces-flow-tutorial The sample seems to be really simple, it only have one flow with 3 facelets, with this structure: The...

Override default validator of input in composite component

validation,jsf,jsf-2.2,composite-component
I'm developing a composite component with a default validator that may be used alongside a more restrictive custom validator. However, it didn't work as intented. I boiled down the problem as below: <h:inputText id="textId" value="#{bean.text}"> <f:validateLength for="textId" maximum="10" /> <f:validateLength for="textId" maximum="5" /> </h:inputText> The validation for maximum=5 is not...

inputtext returns null after update the disabled/readonly option true to false

jsf,primefaces,jsf-2.2
I have a switch (boolean).And when switch is true,inputtext disabled option is true.When switch is false,inputtext disabled option is false and so I can input data.But this data returns null. <h:form id="form"> <p:inputSwitch value="#{switchMB.isTrue}" onLabel="True" offLabel="False"> <p:ajax update="inputText" /> </p:inputSwitch> <p:inputText id="inputText" value="#{switchMB.inputTextValue}" disabled="#{switchMB.isTrue}" /> <p:commandButton action="#{switchMB.addValue}" update=":form"...

Conditionally render components with ajax conditionally only if validation passes

validation,jsf,jsf-2.2,conditional-rendering
I am using JSF 2.2 and I was wondering if there is a way to render components with ajax conditionally only if the validation passes. By using the render attribute of ajax the components will be rendered regardless of the validation passing or not. What I'm after is something like:...

valueChangeListener, onchange and auto-submission of form using JSF

html,jsf,jsf-2.2,valuechangelistener
For a simple html page like this: <form action="success.html" > <input type="text" value="SomeValue" onchange="this.form.submit()"/> <input type="submit" value="Submit"/> </form> Any change of the value results in auto-submit of the form to navigate to success.html Consider the following snippet in JSF 2.x: <h:form > <h:panelGrid columns="3"> <h:outputLabel value="Name: " /> <h:inputText id="inputname"...