Issue 1:
Florian Fankhauser opened SPR-7638 and commented

I want to display a java.util.Date value from the model using the spring:eval-tag like this:

<spring:eval expression="dateOfBirth" />

Now I start Tomcat and open the page let's say in Firefox. It works fine, the page displays as expected. Now I start another web-browser, let's say Safari, to simulate another user-session. When I try to open the page with Safari, I get the following Exception:

org.apache.jasper.JasperException:

org.springframework.expression.spel.SpelEvaluationException:

EL1021E:(pos 0): A problem occurred whilst attempting to access the

property 'dateOfBirth': 'Unexpected exception occurred accessing

'dateOfBirth' as an implicit variable'

When I refresh the page in Safari the exception continues to show up.

When I refresh the page in Firefox, it works without any problem.

It seems to me, that spring:eval only works in the first user-session in this case but not in any further user-sessions.

This problem exists since version 3.0.4.

Steps to reproduce:

With STS create a new Spring Template Project of type MVC.

Open pom.xml and change the spring-version to 3.0.4.

Change the welcome()-method in WelcomeController.java to:

public void welcome(Model model) {

model.addAttribute("dateOfBirth", new Date());

}

Open the welcome.jsp file and add this spring:eval-tag below the h1-tag:

<spring:eval expression="dateOfBirth" />

Start Tomcat and try to open the site with to different web-browsers. In the second browser the exception is shown.

I have attached the sample-project to reproduce the problem.

The complete exception shown:

org.apache.jasper.JasperException: org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'dateOfBirth': 'Unexpected exception occurred accessing 'dateOfBirth' as an implicit variable'

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)

org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)

org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)

org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

root cause

org.springframework.expression.spel.SpelEvaluationException: EL1021E:(pos 0): A problem occurred whilst attempting to access the property 'dateOfBirth': 'Unexpected exception occurred accessing 'dateOfBirth' as an implicit variable'

org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:199)

org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)

org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)

org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)

org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)

org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)

org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)

org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

root cause

org.springframework.expression.AccessException: Unexpected exception occurred accessing 'dateOfBirth' as an implicit variable

org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.resolveImplicitVariable(EvalTag.java:186)

org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.canRead(EvalTag.java:159)

org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:189)

org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)

org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)

org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)

org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)

org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)

org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)

org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

root cause

java.lang.NullPointerException

org.apache.jasper.runtime.PageContextImpl.doFindAttribute(PageContextImpl.java:467)

org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java:457)

javax.servlet.jsp.el.ScopedAttributeELResolver.getValue(ScopedAttributeELResolver.java:53)

javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)

org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32)

org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.resolveImplicitVariable(EvalTag.java:183)

org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.canRead(EvalTag.java:159)

org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:189)

org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)

org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)

org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)

org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)

org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)

org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)

org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)

org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.

Affects: 3.0.4

Attachments:

evaltagtest.zip (13.54 kB)

Issue Links:

#12140 Exception (SpelEvaluationException: EL1021E) when using spring:eval with Jetty ("duplicates")

Issue 2:
Jose Noheda opened SPR-5016 and commented

context:property-placeholder/ only has an attribute (location). This is not enough for advance usage. Please add others like ignoreUnresolvablePlaceholders.

Affects: 2.5.5

Issue Links:

#9338 Improve context-property-placeholder configurablity ("duplicates")