NotSerializableException: org.springframework.binding.mapping.impl.DefaultMappingResults - jsf-2.2

I'm getting
Caused by: org.springframework.webflow.execution.repository.snapshot.SnapshotCreationException: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable
at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.<init>(SerializedFlowExecutionSnapshot.java:75)
at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.createSnapshot(SerializedFlowExecutionSnapshotFactory.java:70)
at org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository.snapshot(AbstractSnapshottingFlowExecutionRepository.java:75)
at org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.putFlowExecution(DefaultFlowExecutionRepository.java:126)
at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:171)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:228)
at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:57)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
... 46 more
Caused by: java.io.NotSerializableException: org.springframework.binding.mapping.impl.DefaultMappingResults
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
so that NotSerializableException completely eats root cause making it impossible to figure out what's happend. The not serializable DefaultMappingResults come from
"lastError" -> "org.springframework.webflow.engine.FlowInputMappingException: Errors occurred during input mapping in state 'openAgreement' of flow 'menu'; errors = [[SourceAccessError#226a8851 mapping = flowScope.securityCards.selectedRow.agreementId -> agreementId, code = 'evaluationException', error = true, errorCause = org.springframework.binding.expression.EvaluationException: An ELException occurred getting the value for expression 'flowScope.securityCards.selectedRow.agreementId' on context [class org.springframework.webflow.engine.impl.RequestControlContextImpl], originalValue = [null], mappedValue = [null]]]"
Not sure if it's related but the problem poped up after updating JSF from 2.1 to 2.2 but most likely there were no root error under 2.1
The problem somehwat resambles this one but not sure.
the openAgreement state:
<subflow-state id="openAgreement" subflow="menu">
<on-entry>
<evaluate expression="agreementService.init()" result="flowScope.agreementReadCriteria" />
</on-entry>
<input name="agreementReadCriteria" value="flowScope.agreementReadCriteria"/>
<input name="agreementId" value="flowScope.securityCards.selectedRow.agreementId"/>
<input name="currentBankId" value="flowScope.currentBankId"/>
<input name="goToAgreement" value="true"/>
<transition on="closeAgreement" to="securityCardsViewBasic">
</transition>
</subflow-state>

Related

Send additional parameter to p:jax event listener

I have something like the following in my XHTML
<h:selectBooleanCheckbox value="" id="negative">
<f:attribute name="myParam" value="#{drugs.pkgId}" />
<p:ajax process="#this" event="change" listener="#{contolerYYY.viewItem}" />
</h:selectBooleanCheckbox>
and I try to access the like the following in my controller,
public void viewItem(SelectEvent event) {
String myParam= (String) event.getComponent().getAttributes().get("myParam");
logger.info("viewItem : " + myParam);
}
but whenever I click the check box I get the following exception and the control does not go to the method.
15:49:45,506 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-/127.0.0.1:443-3) javax.faces.component.UpdateModelException: javax.el.PropertyNotWritableException: /myFile.xhtml #243,68 value="": JBWEB006018: Illegal Syntax for Set Operation
at javax.faces.component.UIInput.updateModel(UIInput.java:857)
at javax.faces.component.UIInput.processUpdates(UIInput.java:739)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:538)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1652)
at org.primefaces.component.api.UIData.visitColumnContent(UIData.java:1014)
at org.primefaces.component.api.UIData.visitRows(UIData.java:988)
at org.primefaces.component.api.UIData.visitTree(UIData.java:842)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1663)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:383)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:257)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:57)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:57)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
at org.omnifaces.context.OmniPartialViewContext.processPartial(OmniPartialViewContext.java:143)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1221)
at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at net.stafftrack.ui.web.security.filter.SecurityFilter.processSTNRequest(SecurityFilter.java:132)
at net.stafftrack.ui.web.security.filter.SecurityFilter.doFilter(SecurityFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:512)
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.el.PropertyNotWritableException: /myFile.xhtml #243,68 value="": JBWEB006018: Illegal Syntax for Set Operation
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:136)
at javax.faces.component.UIInput.updateModel(UIInput.java:822)
... 48 more
My intention is to send a value to method via Ajax and could some one help me to find out the cause please.
It worked when i changed the method signature to viewItem(AjaxBehaviorEvent event)
Thanks

PropertyNotFoundException when using bean's method's result for <h:selectBooleanCheckbox/>

Environment:
PrimeFaces 5.1
Mojarra 2.2.2
Spring 4.0.2
Current Code:
I have the following XHTML page:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core"
template="/WEB-INF/pages/main/admin.xhtml">
<ui:define name="contentBody">
<p:dataTable widgetVar="weekdayTable"
value="#{weekdayList.countries}"
var="ctr"
styleClass="weekdaysManagementDatatable">
<p:column width="100"
sortBy="#{ctr.desc}"
headerText="#{msg['page.admin.weekday.list.country']}">
<h:outputText value="#{ctr.desc}" />
</p:column>
<c:forEach items="#{weekdayList.weekdays}" var="day">
<c:set var="open" value="#{weekdayList.checkOpen(ctr.id, day.date)}"/>
<p:column width="20" headerText="#{utils.dateToDayWeek(day.date)}">
<h:selectBooleanCheckbox value="#{open}">
<p:ajax listener="#{weekdayList.handleDay(ctr.id, day.id)}" />
</h:selectBooleanCheckbox>
</p:column>
</c:forEach>
</p:dataTable>
</ui:define>
</ui:composition>
The associated bean is the following :
#Named("weekdayList")
#Scope("session")
public class AdminWeekdayListController implements Serializable {
...
public boolean checkOpen(String ctrId, Date date) {
Country ctr = countryDao.getById(ctrId);
List<WeekDay> list = weekdaysMap.get(ctr);
if (list == null) {
return true;
}
WeekDay day = new WeekDay();
day.setDate(date);
for (WeekDay wd : list) {
if (wd.compareTo(day) == 0) {
return wd.isOpen();
}
}
return true;
}
}
I have another bean which maintains the current page to display and the whole the application is made with AJAX. The user is always on the same page and the content is dynamically loaded.
The problem:
When I reload (F5) the page, all seems to work correctly.
But, if I go trought the normal navigation (AJAX loading), I have got a PropertyNotFoundException...
Here is the stack trace:
SEVERE: javax.faces.component.UpdateModelException: javax.el.PropertyNotFoundException: /WEB-INF/pages/main/admin/weekdayList.xhtml #32,47 value="#{open}": /WEB-INF/pages/main/admin/weekdayList.xhtml #29,74 value="#{weekdayList.checkOpen(ctr.id, day.date)}": Property 'checkOpen' not found on type stomac.web.controller.AdminWeekdayListController
at javax.faces.component.UIInput.updateModel(UIInput.java:867)
at javax.faces.component.UIInput.processUpdates(UIInput.java:749)
at org.primefaces.component.api.UIData.process(UIData.java:342)
at org.primefaces.component.api.UIData.processChildren(UIData.java:323)
at org.primefaces.component.api.UIData.processPhase(UIData.java:285)
at org.primefaces.component.api.UIData.processUpdates(UIData.java:271)
at org.primefaces.component.datatable.DataTable.processUpdates(DataTable.java:651)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1286)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1286)
at javax.faces.component.UIForm.processUpdates(UIForm.java:281)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1286)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1286)
at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:1254)
at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:78)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.el.PropertyNotFoundException: /WEB-INF/pages/main/admin/weekdayList.xhtml #32,47 value="#{open}": /WEB-INF/pages/main/admin/weekdayList.xhtml #29,74 value="#{weekdayList.checkOpen(ctr.id, day.date)}": Property 'checkOpen' not found on type stomac.web.controller.AdminWeekdayListController
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:133)
at javax.faces.component.UIInput.updateModel(UIInput.java:832)
... 36 more
Caused by: javax.el.PropertyNotFoundException: /WEB-INF/pages/main/admin/weekdayList.xhtml #29,74 value="#{weekdayList.checkOpen(ctr.id, day.date)}": Property 'checkOpen' not found on type stomac.web.controller.AdminWeekdayListController
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:133)
at org.apache.el.parser.AstIdentifier.setValue(AstIdentifier.java:129)
at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:260)
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
... 37 more
Caused by: javax.el.PropertyNotFoundException: Property 'checkOpen' not found on type stomac.web.controller.AdminWeekdayListController
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:245)
at javax.el.BeanELResolver$BeanProperties.access$300(BeanELResolver.java:222)
at javax.el.BeanELResolver.property(BeanELResolver.java:332)
at javax.el.BeanELResolver.getType(BeanELResolver.java:82)
at com.sun.faces.el.DemuxCompositeELResolver._getType(DemuxCompositeELResolver.java:215)
at com.sun.faces.el.DemuxCompositeELResolver.getType(DemuxCompositeELResolver.java:242)
at org.apache.el.parser.AstValue.setValue(AstValue.java:199)
at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:260)
at com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131)
... 40 more
But what make me think that the problem does not come from my bean is, if I remove the #{open} from the value of the <h:selectBooleanCheckbox/> it perfectly works (except that the checkboxes are not checked the way I want):
<c:forEach items="#{weekdayList.weekdays}" var="day">
<c:set var="open" value="#{weekdayList.checkOpen(ctr.id, day.date)}"/>
<p:column width="20" headerText="#{utils.dateToDayWeek(day.date)}">
#{open}
<h:selectBooleanCheckbox value="true">
<p:ajax listener="#{weekdayList.handleDay(ctr.id, day.id)}" />
</h:selectBooleanCheckbox>
</p:column>
</c:forEach>
As you can see I keep using #{open} but not inside the value attibute.
Questions:
What did I wrong? Am I missing something? Is there a bug?
Thanks.
So... I have found a "solution", and respond to my own question.
I added fakes getter and setter for the method checkOpen. So the bean looks like this:
#Named("weekdayList")
#Scope("session")
public class AdminWeekdayListController implements Serializable {
...
public boolean getCheckOpen() {
return true;
}
public void setCheckOpen(boolean b) {
}
public boolean checkOpen(String ctrId, Date date) {
Country ctr = countryDao.getById(ctrId);
List<WeekDay> list = weekdaysMap.get(ctr);
if (list == null) {
return true;
}
WeekDay day = new WeekDay();
day.setDate(date);
for (WeekDay wd : list) {
if (wd.compareTo(day) == 0) {
return wd.isOpen();
}
}
return true;
}
}
This way JSF thinks checkOpen is a valid (read/write) attribute, BUT calls checkOpen(String ctrId, Date date). It never calls the getter or the setter...
If someone can explain this, I will be gratefull. And if someone has a better solution, I am listening.
its the LifeCycle of Taghandlers and UI components.
JSTL-Tags in JSF do not represent components and never become part of the component tree once the view has been built.
TagHandlers are responsible for building the tree, "Once they have done their job, they expire". this means, they are available only in the View Building Phase. at the other hand UI-Components run in View Rendering Phase.

Property '0' not found on type java.lang.String

I am working on a SpringMVC 3 and Roo project. Now there is a web tier dead end. Basically it is a type conversion issue, driving me mad
I try to pass the record counter when iterate a list of table rows(here is SystemSettings table, then each row is a system setting). In the jspx file, I made the following looping:
<form:form action="${form_url}" method="post" modelAttribute="formSettings">
<c:forEach items="${settings}" var="item" varStatus="status">
<c:set value="${item.actionType}" var="type"/>
<c:set value="${item.name}" var="name"/>
<c:set value="${item.setting}" var="value"/>
<!-- -->
<field:complex field="setting" id="l_com_transoftinc_vlm_carrierweb_domain_systemsetting_${name}" object="${item}" setting="${value}" type="${type}" cnt="${status.count-1}" formBacking="formSettings" z="user-managed"/>
</c:forEach>
So that the status count can pass the counter value to the "complex.tagx". Here it is simplified like this:
<jsp:directive.attribute name="cnt" type="java.lang.Integer" required="false" rtexprvalue="true" description="counter variable" />
<c:choose>
<c:when test="${fn:toLowerCase(type) eq 'checkbox'}">
<input type="checkbox" name="${formBacking[cnt].field}" value="TRUE" checked="${fn:toLowerCase(setting) eq 'true' ? 'checked' : ''}"/>
</c:when>
<c:when test="${fn:toLowerCase(type) eq 'inputbox'}">
<input type="input" name="${formBacking[cnt].field}" value="${setting}"/>
</c:when>
</c:choose>
I didn't put all the attributes here to make the code section too verbose. But I get very nasty exception telling me the counter (which of course returns 0 in the first looping) is not a type of String? I thought JSTL can automatically convert it. However, I know I use three variable to compose the component name may be not a good idea, but I am don't understand this exception, here it is, please help, thanks a lot!
May 14, 2012 6:39:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [OptiVLM-CarrierWeb] in context with path [/OptiVLM-CarrierWeb] threw exception [Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/layouts/default.jspx'.] with root cause
javax.el.PropertyNotFoundException: Property '0' not found on type java.lang.String
at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:237)
at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:214)
at javax.el.BeanELResolver.property(BeanELResolver.java:325)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
This exception indicates that ${formBacking} is actually a java.lang.String, not an array or a List on which the indexed access by brace notation would work.
And indeed, you're specifying it as a plain vanilla string on the tag:
<field:complex ... formBacking="formSettings" />
Likely you meant it to be an EL expression instead:
<field:complex ... formBacking="${formSettings}" />
You only still need to make sure that it's really an array or a List.

Spring Validation ... Validator is working, but errors are not displaying

Ok I have two pages in my application that are very similar. addressForm.jsp, and termsForm.jsp .... Each page has a Spring validator for it's fields. Address form is working fine. The terms form validator runs, I see the errors in the errors object in the log, but the jsp is not displaying the errors.
Address form ...
<form:form htmlEscape="false" name="addressForm" commandName="vendorTransmittal" method="post" action="${onboardingActionUrl}">
<form:errors path="*" cssClass="errorblock" element="div"/>
Terms form ... only difference is the encoding type, as the terms form has a file upload piece ... not sure if that could be messing up the error display.
<form htmlEscape="false" name="termsForm" commandName="vendorTransmittal" method="post" action="${uploadFileUrl}" enctype="multipart/form-data">
<form:errors path="*" cssClass="errorblock" element="div"/>
The errors are there
[5/4/12 9:23:17:649 EDT] 0000003a SystemOut O 52945 [WebContainer : 6] DEBUG com.bedbath.vendorportal.onboarding.validator.TermsFormValidator - Retrieved error Field error in object 'vendorTransmittal' on field 'VTShippingMinimumTypeId': rejected value [1]; codes [invalidValue.shippingMinimumType.vendorTransmittal.VTShippingMinimumTypeId,invalidValue.shippingMinimumType.VTShippingMinimumTypeId,invalidValue.shippingMinimumType.java.lang.Integer,invalidValue.shippingMinimumType]; arguments []; default message [Shipping Minimum Type should not be entered if there is no Shipping Minimum]
Controller recognizes the errors, and routes back to the same page as expected. They just don't display .
Any thoughts ?
It looks like your second form is HTML <form>, not Spring <form:form>. <form:errors> can only be used inside <form:form>.

passing validator to a custom component, fails

I have a simple inputText with a validator:
<ice:inputText
id="test"
value="#{applicationBean.selectedApplication['name']}"
validator="defaultFieldValidator"
required="true"></ice:inputText>
<ice:message
styleClass="graValidationMessage graNotRequired"
for="test" />
You may have noticed that I specified a validator: defaultFieldValidator and all works fine.
I now make a component to act like a wrapper for the inputText named: inputTextValidated:
<ice:inputText
id="#{id}#{required}"
value="#{bean[field]}"
rendered="#{rendered}"
styleClass="#{styleClass} #{not required ? 'graNotRequired':''}"
style="width: #{width};"
partialSubmit="#{partialSubmit}"
disabled="#{disabled}"
required="#{required}"
validator="#{validatorClass}">
</ice:inputText>
If I try now to call this component (with the same validator for beginning passed now through a parameter):
<gra:inputTextValidated
id="inputText"
bean="#{applicationBean.selectedApplication}"
field="#{fieldValue}"
validatorClass="defaultFieldValidator"
renderLabel="false"
required="true"
disabled="false"
width="90%"
height="#{secondTabComponentsHeight}">
</gra:inputTextValidated>
if fails with the following error:
Identity 'validatorClass' does not reference a MethodExpression instance, returned type: java.lang.String
So the problem is when sending the validator name to my custom component.
Do you see a work-around?
Thanks.
I've ended up using
<f:validatorId validatorId="#{validatorClass}"/>
inside my inputText component

Resources