<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ffankhauser" rel="nofollow">Florian Fankhauser</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7638?redirect=false" rel="nofollow">SPR-7638</a></strong> and commented</p>
<p dir="auto">I want to display a java.util.Date value from the model using the spring:eval-tag like this:</p>
<p dir="auto">&lt;spring:eval expression="dateOfBirth" /&gt;</p>
<p dir="auto">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:</p>
<p dir="auto">org.apache.jasper.JasperException:<br>
org.springframework.expression.spel.SpelEvaluationException:<br>
EL1021E:(pos 0): A problem occurred whilst attempting to access the<br>
property 'dateOfBirth': 'Unexpected exception occurred accessing<br>
'dateOfBirth' as an implicit variable'</p>
<p dir="auto">When I refresh the page in Safari the exception continues to show up.<br>
When I refresh the page in Firefox, it works without any problem.</p>
<p dir="auto">It seems to me, that spring:eval only works in the first user-session in this case but not in any further user-sessions.<br>
This problem exists since version 3.0.4.</p>
<p dir="auto">Steps to reproduce:</p>
<hr>
<ol dir="auto">
<li>With STS create a new Spring Template Project of type MVC.</li>
<li>Open pom.xml and change the spring-version to 3.0.4.</li>
<li>Change the welcome()-method in WelcomeController.java to:</li>
</ol>
<p dir="auto">public void welcome(Model model) {<br>
model.addAttribute("dateOfBirth", new Date());<br>
}</p>
<ol start="4" dir="auto">
<li>Open the welcome.jsp file and add this spring:eval-tag below the h1-tag:</li>
</ol>
<p dir="auto">&lt;spring:eval expression="dateOfBirth" /&gt;</p>
<ol start="5" dir="auto">
<li>Start Tomcat and try to open the site with to different web-browsers. In the second browser the exception is shown.</li>
</ol>
<p dir="auto">I have attached the sample-project to reproduce the problem.</p>
<p dir="auto">The complete exception shown:</p>
<hr>
<p dir="auto">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'<br>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)<br>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)<br>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)<br>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)<br>
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)<br>
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)<br>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)<br>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)<br>
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)<br>
root cause</p>
<p dir="auto">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'<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:199)<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)<br>
org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)<br>
org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)<br>
org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)<br>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)<br>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)<br>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)<br>
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)<br>
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)<br>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)<br>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)<br>
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)<br>
root cause</p>
<p dir="auto">org.springframework.expression.AccessException: Unexpected exception occurred accessing 'dateOfBirth' as an implicit variable<br>
org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.resolveImplicitVariable(EvalTag.java:186)<br>
org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.canRead(EvalTag.java:159)<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:189)<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)<br>
org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)<br>
org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)<br>
org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)<br>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)<br>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)<br>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)<br>
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)<br>
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)<br>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)<br>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)<br>
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)<br>
root cause</p>
<p dir="auto">java.lang.NullPointerException<br>
org.apache.jasper.runtime.PageContextImpl.doFindAttribute(PageContextImpl.java:467)<br>
org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java:457)<br>
javax.servlet.jsp.el.ScopedAttributeELResolver.getValue(ScopedAttributeELResolver.java:53)<br>
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)<br>
org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32)<br>
org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.resolveImplicitVariable(EvalTag.java:183)<br>
org.springframework.web.servlet.tags.EvalTag$JspPropertyAccessor.canRead(EvalTag.java:159)<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:189)<br>
org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:71)<br>
org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)<br>
org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)<br>
org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:113)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspx_meth_spring_005feval_005f0(welcome_jsp.java:99)<br>
org.apache.jsp.WEB_002dINF.views.welcome_jsp._jspService(welcome_jsp.java:69)<br>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)<br>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)<br>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)<br>
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)<br>
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)<br>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)<br>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)<br>
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br>
org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)<br>
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)<br>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)<br>
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17182/evaltagtest.zip" rel="nofollow">evaltagtest.zip</a> (<em>13.54 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398106970" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12140" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12140/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12140">#12140</a> Exception (SpelEvaluationException: EL1021E) when using spring:eval with Jetty (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=xmaniac" rel="nofollow">Jose Noheda</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5016?redirect=false" rel="nofollow">SPR-5016</a></strong> and commented</p>
<p dir="auto">context:property-placeholder/ only has an attribute (location). This is not enough for advance usage. Please add others like ignoreUnresolvablePlaceholders.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.5</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398087043" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9338" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9338/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9338">#9338</a> Improve context-property-placeholder configurablity (<em><strong>"duplicates"</strong></em>)</li>
</ul>