Fix NumberFormatException in messages.jsp type checking#398
Merged
Conversation
Replace EL expression `${errors.class.simpleName}` with scriptlet-based
type checking to avoid NumberFormatException in modern EL resolvers.
The issue occurred because when `errors` is a List, the EL resolver
tries to interpret `.class` as a list index access, attempting to parse
"class" as an integer, which fails with NumberFormatException.
Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix number format exception when entering citation
Fix NumberFormatException in messages.jsp type checking
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NumberFormatException: For input string: "class"thrown when entering citations. The EL expression${errors.class.simpleName}fails in Tomcat 9+ because whenerrorsis a List, the EL resolver interprets.classas a list index access and tries to parse "class" as an integer.Changes
instanceof Stringcheck inmessages.jsperrorsandmessagesvariablesBefore
After
Original prompt
I try to enter a citation and:
Yikes!
java.lang.NumberFormatException: For input string: "class"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
at java.base/java.lang.Integer.parseInt(Integer.java:668)
at java.base/java.lang.Integer.parseInt(Integer.java:786)
at javax.el.ListELResolver.coerce(ListELResolver.java:144)
at javax.el.ListELResolver.getValue(ListELResolver.java:64)
at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:123)
at org.apache.el.parser.AstValue.getValue(AstValue.java:160)
at org.apache.el.parser.AstEqual.getValue(AstEqual.java:33)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:149)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:655)
at org.apache.jsp.decorators.defaultTemplate_jsp._jspx_meth_c_005fwhen_005f0(defaultTemplate_jsp.java:1227)
at org.apache.jsp.decorators.defaultTemplate_jsp._jspx_meth_c_005fchoose_005f0(defaultTemplate_jsp.java:1198)
at org.apache.jsp.decorators.defaultTemplate_jsp._jspx_meth_c_005fif_005f1(defaultTemplate_jsp.java:1165)
at org.apache.jsp.decorators.defaultTemplate_jsp._jspService(defaultTemplate_jsp.java:439)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:349)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:300)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:619)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:496)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:444)
at com.opensymphony.module.sitemesh.filter.PageFilter.writeDecorator(PageFilter.java:173)
at com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:158)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:352)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:117)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:164)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:361)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107)
at org.springframework.security.web.authen...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.