dataExporter EL problem

UI Components for JSF
Post Reply
André G.
Posts: 31
Joined: 20 Dec 2011, 14:05

13 Mar 2012, 15:45

There seems to be a problem with the data exporter component, if you are using some more advanced EL features like "size()" in your data table:

Example:

Code: Select all

<p:dataTable id="dt_my_submissions"	 value="#{mySubmissionsBean.submissions}" var="submission"  >
	<p:column headerText="#" >
		<h:outputText value="#{submission.items.size()}" />
	</p:column>
</p:dataTable>

<h:commandLink>  
	<h:outputText value="xls"></h:outputText>
	<p:dataExporter type="xls" target="dt_my_submissions" fileName="submissions" />  
</h:commandLink>
The code above displays well on the screen, but hitting the command link results in a number format exception:

Code: Select all

13.03.2012 14:27:55 org.apache.catalina.core.StandardWrapperValve invoke
SCHWERWIEGEND: Servlet.service() for servlet [Faces Servlet] in context with path [/ilse-wui] threw exception [For input string: "size"] with root cause
java.lang.NumberFormatException: For input string: "size"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:481)
	at java.lang.Integer.parseInt(Integer.java:514)
	at javax.el.ListELResolver.coerce(ListELResolver.java:173)
	at javax.el.ListELResolver.getType(ListELResolver.java:72)
	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.getType(AstValue.java:84)
	at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:176)
	at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
	at org.primefaces.component.export.Exporter.exportValue(Exporter.java:132)
	at org.primefaces.component.export.ExcelExporter.addColumnValue(ExcelExporter.java:200)
	at org.primefaces.component.export.ExcelExporter.exportAll(ExcelExporter.java:170)
	at org.primefaces.component.export.ExcelExporter.export(ExcelExporter.java:57)
	at org.primefaces.component.export.DataExporter.processAction(DataExporter.java:102)
	at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
	at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
	at javax.faces.component.UICommand.broadcast(UICommand.java:300)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
	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:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at de.dkfz.ilse.CacheControlFilter.doFilter(CacheControlFilter.java:36)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:119)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Is this a known problem?

One more somehow related problem:
dataexporter doesn't recognize "headerText" as the column's name. 'facet name="header"' is working though.
PrimeFaces 6.0.7 with Mojarra 2.2.14 on Tomcat 7.72.

André G.
Posts: 31
Joined: 20 Dec 2011, 14:05

13 Mar 2012, 16:12

Sorry, did forget the version information:

PrimeFaces: 3.2
JSF implementation: Mojarra 2.1.4
Server: Tomcat 7.0.25
PrimeFaces 6.0.7 with Mojarra 2.2.14 on Tomcat 7.72.

Hamsterbau
Posts: 409
Joined: 28 Dec 2011, 17:44

13 Mar 2012, 17:43

Can you try JSTL length function instead?:

Code: Select all

xmlns:fn="http://java.sun.com/jsp/jstl/functions"

...

<h:outputText value="#{fn:length(submission.items)}" />

I am not 100% sure, but you are using Tomcat (which is part of JBoss AS) and there exists a problem with EL functions without parameter:
https://community.jboss.org/thread/164602
Primefaces 8.0.7 (PF Extensions 8.0)
JSF: Mojarra 2.3.2 (Spec 2.3) - running on WildFly 22

André G.
Posts: 31
Joined: 20 Dec 2011, 14:05

13 Mar 2012, 18:17

Hamsterbau wrote:Can you try JSTL length function instead?
This does the trick! I'm not really comfortable using a jsp tag library with facelets, but anyway: Thanks!
PrimeFaces 6.0.7 with Mojarra 2.2.14 on Tomcat 7.72.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests