Bug 46381 - Coerce EL expression to java.lang.Object breaks expression concatenation
Coerce EL expression to java.lang.Object breaks expression concatenation
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Servlet & JSP API
unspecified
PC Windows XP
: P2 critical (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-12-11 07:13 UTC by Fabian Necci
Modified: 2009-07-07 03:56 UTC (History)
2 users (show)



Attachments
Source file (1.39 KB, application/octet-stream)
2008-12-11 07:13 UTC, Fabian Necci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Necci 2008-12-11 07:13:00 UTC
Created attachment 23009 [details]
Source file

I have a simple <c:set> tag with expression concatenation. This tag breaks with this stack trace:

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 22 in the jsp file: /templates/paragraphs/notizia.jsp
The operator + is undefined for the argument type(s) java.lang.Object, java.lang.Object
19:       <c:when test="${!empty(node.link)}">
20:         <c:set value="${node.link}" var="url" />
21:         <c:if test="${!(fn:startsWith(url,'http'))}">
22:           <c:set value="${pageContext.request.contextPath}${url}" var="url" />
23:           <c:set value=" " var="target" />
24:         </c:if>
25:         <a href="${url}" class="${target}">${node.testo}</a>


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at info.magnolia.context.WebContextImpl.include(WebContextImpl.java:191)
	at info.magnolia.module.templating.paragraphs.JspParagraphRenderer.render(JspParagraphRenderer.java:73)
	at info.magnolia.cms.beans.config.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:112)
	at info.magnolia.cms.beans.config.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:91)
	at info.magnolia.cms.taglibs.Include.doEndTag(Include.java:192)
	at org.apache.jsp.templates.paragraphs.bloccoInfo_jsp._jspx_meth_cms_005fincludeTemplate_005f0(bloccoInfo_jsp.java:332)
	at org.apache.jsp.templates.paragraphs.bloccoInfo_jsp._jspx_meth_cms_005fcontentNodeIterator_005f0(bloccoInfo_jsp.java:289)
	at org.apache.jsp.templates.paragraphs.bloccoInfo_jsp._jspService(bloccoInfo_jsp.java:98)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
	at info.magnolia.context.WebContextImpl.include(WebContextImpl.java:191)
	at info.magnolia.module.templating.paragraphs.JspParagraphRenderer.render(JspParagraphRenderer.java:73)
	at info.magnolia.cms.beans.config.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:112)
	at info.magnolia.cms.beans.config.ParagraphRenderingFacade.render(ParagraphRenderingFacade.java:91)
	at info.magnolia.cms.taglibs.Include.doEndTag(Include.java:192)
	at org.apache.jsp.templates.pages.firstlevelgruppo_jsp._jspx_meth_cms_005fincludeTemplate_005f1(firstlevelgruppo_jsp.java:428)
	at org.apache.jsp.templates.pages.firstlevelgruppo_jsp._jspx_meth_cms_005fcontentNodeIterator_005f1(firstlevelgruppo_jsp.java:385)
	at org.apache.jsp.templates.pages.firstlevelgruppo_jsp._jspService(firstlevelgruppo_jsp.java:115)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:100)
	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:200)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at info.magnolia.module.templating.renderers.JspTemplateRenderer.renderTemplate(JspTemplateRenderer.java:78)
	at info.magnolia.cms.filters.RenderingFilter.doFilter(RenderingFilter.java:103)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.BackwardCompatibilityFilter.doFilter(BackwardCompatibilityFilter.java:72)
	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.InterceptFilter.doFilter(InterceptFilter.java:117)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.AggregatorFilter.doFilter(AggregatorFilter.java:111)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:61)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.RepositoryMappingFilter.doFilter(RepositoryMappingFilter.java:90)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:64)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:65)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:64)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.VirtualUriFilter.doFilter(VirtualUriFilter.java:115)
	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:75)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:180)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.module.cache.executor.Bypass.processCacheRequest(Bypass.java:57)
	at info.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:118)
	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:84)
	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:73)
	at info.magnolia.cms.filters.CosMultipartRequestFilter.doFilter(CosMultipartRequestFilter.java:84)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:61)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:81)
	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:76)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:80)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:72)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:71)
	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:64)
	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:71)
	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:97)
	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:200)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at it.ragno.web.filters.LocaleSyncFilter.doFilter(LocaleSyncFilter.java:82)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Comment 1 Mark Thomas 2008-12-26 15:43:42 UTC
I have applied a fix to trunk but I want to do some more testing with the TCK (which I don't have to immediately to hand) before proposing for 6.0.x
Comment 2 Mark Thomas 2008-12-27 13:36:30 UTC
The TCK passes so this has been proposed for 6.0.x
Comment 3 Mark Thomas 2009-01-14 15:51:55 UTC
This has been fixed in 6.0.x and will be include din 6.0.19 onwards.
Comment 4 Alfred Staflinger 2009-06-08 07:14:09 UTC
Dear Tomcat Developers,

when i have a JSP page with this tag/expression...

<c:out value="${assignment.companyHeader.address.name01} ${assignment.companyHeader.address.name02}" />

... and "companyHeader" evaluates to null, 

the output in Tomcat 6.0.18 is " " (which is correct),

but the output in Tomcat 6.0.20 is "null " (which is not correct).

I think that many JSP developers are concerned by this bug and I hope that there will be released a new Tomcat version containing a bug fix as soon as possible.

Best Regards
Alfred
Comment 5 Mark Thomas 2009-07-07 03:56:21 UTC
Comment #4 looks like a separate issue and bug47487 has now been opened for it.