Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4153

Struts2 select tag broken if multiple attribute is used and name attribute is not specified

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.1
    • Fix Version/s: 2.3.16
    • Component/s: None
    • Labels:
      None
    • Environment:

      JBoss AS7+ Spring on Ubuntu

      Description

      I'm facing a problem when i don't specify name attribute in struts select tag, where the same tag was working fine in earlier release (2.3.4 *) . My select tag is as follows

      <s:select headerKey="" headerValue="%{getText('sel.dept')}" id="departments"  list="dropdownData.departments"
      listValue="deptName" listKey="id"  theme="simple" tabindex="1"  multiple="true" size="5" cssStyle="min-width:130px"/>
      

      The exception is as follows and it got disappeared when i add name attribute

      ERROR [freemarker.runtime] (http-localhost/127.0.0.1:8080-3) Template processing error: "Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl.": freemarker.core.InvalidReferenceException: Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl.
      	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Expression.getStringValue(Expression.java:118) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Expression.getStringValue(Expression.java:93) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Expression.getStringValue(Expression.java:93) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.DollarVariable.accept(DollarVariable.java:76) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Environment.visit(Environment.java:221) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.MixedContent.accept(MixedContent.java:92) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Environment.visit(Environment.java:221) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Environment.visit(Environment.java:221) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.MixedContent.accept(MixedContent.java:92) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Environment.visit(Environment.java:221) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.core.Environment.process(Environment.java:199) [freemarker-2.3.19.jar:2.3.19]
      	at freemarker.template.Template.process(Template.java:259) [freemarker-2.3.19.jar:2.3.19]
      	at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157) [struts2-core-2.3.15.jar:2.3.15]
      	at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572) [struts2-core-2.3.15.jar:2.3.15]
      	at org.apache.struts2.components.UIBean.end(UIBean.java:526) [struts2-core-2.3.15.jar:2.3.15]
      	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) [struts2-core-2.3.15.jar:2.3.15]
      	at org.apache.jsp.WEB_002dINF.jsp.dms.notificationGroup_jsp._jspx_meth_s_005fselect_005f0(notificationGroup_jsp.java:1171)
      	at org.apache.jsp.WEB_002dINF.jsp.dms.notificationGroup_jsp._jspx_meth_s_005fpush_005f0(notificationGroup_jsp.java:438)
      	at org.apache.jsp.WEB_002dINF.jsp.dms.notificationGroup_jsp._jspx_meth_s_005fform_005f0(notificationGroup_jsp.java:294)
      	at org.apache.jsp.WEB_002dINF.jsp.dms.notificationGroup_jsp._jspService(notificationGroup_jsp.java:157)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) [jbossweb-7.2
      
      1. form_processing.zip
        10 kB
        Bruce Phillips

        Activity

        Hide
        bphillips Bruce Phillips added a comment -

        I will research and see if I can duplicate this bug.

        Show
        bphillips Bruce Phillips added a comment - I will research and see if I can duplicate this bug.
        Hide
        bphillips Bruce Phillips added a comment -

        I could not duplicate the issue. Leaving out the name attribute when using the s:select tag did not cause an exception. I tested using Tomcat 7.

        I wonder if this issue is only found on JBoss AS 7?

        Show
        bphillips Bruce Phillips added a comment - I could not duplicate the issue. Leaving out the name attribute when using the s:select tag did not cause an exception. I tested using Tomcat 7. I wonder if this issue is only found on JBoss AS 7?
        Hide
        nick.sree nick added a comment -

        After some amount of investigation its been found the problem comes when the select tag having multiple="true" attribute.

        Show
        nick.sree nick added a comment - After some amount of investigation its been found the problem comes when the select tag having multiple="true" attribute.
        Hide
        bphillips Bruce Phillips added a comment -

        Nick thank you for the additional information. I was able to verify that if the select tag is used with multiple attribute set and no name attribute is used then an Exception will be generated. I've attached a zipped Maven project that can be used to demonstrate the exception. In register.jsp remove the name attribute, rebuild the .war file and deploy it to your Servlet container. Go to URL http://localhost:8080/form_processing/register.jsp and you will get the following Exception in the logs:

        2013-07-30 06:26:49,385 ERROR freemarker.runtime.error:96 - Template processing error: "Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl."
        Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl.
        The problematic instruction:
        ----------
        ==> $

        {parameters.id?html}

        [on line 122, column 40 in template/simple/select.ftl]
        in include "/$

        {parameters.templateDir}

        /simple/select.ftl" [on line 24, column 1 in template/xhtml/select.ftl]
        ----------

        Java backtrace for programmers:
        ----------
        freemarker.core.InvalidReferenceException: Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.include(Environment.java:1508)
        at freemarker.core.Include.accept(Include.java:169)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.process(Environment.java:199)
        at freemarker.template.Template.process(Template.java:259)
        at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
        at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572)
        at org.apache.struts2.components.UIBean.end(UIBean.java:526)
        at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
        at org.apache.jsp.register_jsp._jspx_meth_s_005fselect_005f0(register_jsp.java:267)
        at org.apache.jsp.register_jsp._jspx_meth_s_005fform_005f0(register_jsp.java:143)
        at org.apache.jsp.register_jsp._jspService(register_jsp.java:87)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
        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:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:680)

        Show
        bphillips Bruce Phillips added a comment - Nick thank you for the additional information. I was able to verify that if the select tag is used with multiple attribute set and no name attribute is used then an Exception will be generated. I've attached a zipped Maven project that can be used to demonstrate the exception. In register.jsp remove the name attribute, rebuild the .war file and deploy it to your Servlet container. Go to URL http://localhost:8080/form_processing/register.jsp and you will get the following Exception in the logs: 2013-07-30 06:26:49,385 ERROR freemarker.runtime.error:96 - Template processing error: "Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl." Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl. The problematic instruction: ---------- ==> $ {parameters.id?html} [on line 122, column 40 in template/simple/select.ftl] in include "/$ {parameters.templateDir} /simple/select.ftl" [on line 24, column 1 in template/xhtml/select.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression parameters.id is undefined on line 122, column 42 in template/simple/select.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) at freemarker.core.Expression.getStringValue(Expression.java:118) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.Environment.include(Environment.java:1508) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.Environment.process(Environment.java:199) at freemarker.template.Template.process(Template.java:259) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572) at org.apache.struts2.components.UIBean.end(UIBean.java:526) at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) at org.apache.jsp.register_jsp._jspx_meth_s_005fselect_005f0(register_jsp.java:267) at org.apache.jsp.register_jsp._jspx_meth_s_005fform_005f0(register_jsp.java:143) at org.apache.jsp.register_jsp._jspService(register_jsp.java:87) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96) 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:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)
        Hide
        bphillips Bruce Phillips added a comment -

        Example application that can be used to verify this issue - see comments

        Show
        bphillips Bruce Phillips added a comment - Example application that can be used to verify this issue - see comments
        Hide
        bphillips Bruce Phillips added a comment -

        Note that if you include the id attribute in the select tag (as the original reporter did) you will get this Exception:

        2013-07-30 06:36:25,986 ERROR freemarker.runtime.error:96 - Template processing error: "Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl."
        Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl.
        The problematic instruction:
        ----------
        ==> $

        {parameters.name?html}

        [on line 122, column 83 in template/simple/select.ftl]
        in include "/$

        {parameters.templateDir}

        /simple/select.ftl" [on line 24, column 1 in template/xhtml/select.ftl]
        ----------

        Java backtrace for programmers:
        ----------
        freemarker.core.InvalidReferenceException: Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.include(Environment.java:1508)
        at freemarker.core.Include.accept(Include.java:169)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:221)
        at freemarker.core.Environment.process(Environment.java:199)
        at freemarker.template.Template.process(Template.java:259)
        at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
        at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572)
        at org.apache.struts2.components.UIBean.end(UIBean.java:526)
        at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
        at org.apache.jsp.register_jsp._jspx_meth_s_005fselect_005f0(register_jsp.java:269)
        at org.apache.jsp.register_jsp._jspx_meth_s_005fform_005f0(register_jsp.java:143)
        at org.apache.jsp.register_jsp._jspService(register_jsp.java:87)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
        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:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:680)

        Show
        bphillips Bruce Phillips added a comment - Note that if you include the id attribute in the select tag (as the original reporter did) you will get this Exception: 2013-07-30 06:36:25,986 ERROR freemarker.runtime.error:96 - Template processing error: "Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl." Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl. The problematic instruction: ---------- ==> $ {parameters.name?html} [on line 122, column 83 in template/simple/select.ftl] in include "/$ {parameters.templateDir} /simple/select.ftl" [on line 24, column 1 in template/xhtml/select.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression parameters.name is undefined on line 122, column 85 in template/simple/select.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) at freemarker.core.Expression.getStringValue(Expression.java:118) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.Environment.include(Environment.java:1508) at freemarker.core.Include.accept(Include.java:169) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:221) at freemarker.core.Environment.process(Environment.java:199) at freemarker.template.Template.process(Template.java:259) at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157) at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572) at org.apache.struts2.components.UIBean.end(UIBean.java:526) at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) at org.apache.jsp.register_jsp._jspx_meth_s_005fselect_005f0(register_jsp.java:269) at org.apache.jsp.register_jsp._jspx_meth_s_005fform_005f0(register_jsp.java:143) at org.apache.jsp.register_jsp._jspService(register_jsp.java:87) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96) 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:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        The change was introduced with WW-2802 in Struts 2.1.8

        Show
        lukaszlenart Lukasz Lenart added a comment - The change was introduced with WW-2802 in Struts 2.1.8
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        nick from which version do you migrate to 2.3.15.1?

        Show
        lukaszlenart Lukasz Lenart added a comment - nick from which version do you migrate to 2.3.15.1?
        Hide
        nick.sree nick added a comment -

        i have migrated from 2.3.4

        Show
        nick.sree nick added a comment - i have migrated from 2.3.4
        Hide
        lukaszlenart Lukasz Lenart added a comment - - edited

        So you should experience the same in 2.3.4 - really strange :\ Or maybe this is side effect of WW-4152 though

        Show
        lukaszlenart Lukasz Lenart added a comment - - edited So you should experience the same in 2.3.4 - really strange :\ Or maybe this is side effect of WW-4152 though
        Hide
        nick.sree nick added a comment - - edited

        @Lukasz, i'm afraid i have tested this use case for 2.3.4 :\. Our migration from 2.1.x to 2.3.x was immediate so im not sure about whether i have tested it in 2.3.4.

        And no its not the side effect of that issue, since its a reproducible error from your end.

        Show
        nick.sree nick added a comment - - edited @Lukasz, i'm afraid i have tested this use case for 2.3.4 :\. Our migration from 2.1.x to 2.3.x was immediate so im not sure about whether i have tested it in 2.3.4. And no its not the side effect of that issue, since its a reproducible error from your end.
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Yes, you are right, this part of select.ftl has to be changed to include case when id and name aren't defined:

        <#if parameters.multiple?default(false)>
        <input type="hidden" id="__multiselect_${parameters.id?html}" name="__multiselect_${parameters.name?html}" value=""<#rt/>
        <#if parameters.disabled?default(false)>
         disabled="disabled"<#rt/>
        </#if>
         />
        </#if>
        
        Show
        lukaszlenart Lukasz Lenart added a comment - Yes, you are right, this part of select.ftl has to be changed to include case when id and name aren't defined: <#if parameters.multiple?default(false)> <input type= "hidden" id= "__multiselect_${parameters.id?html}" name= "__multiselect_${parameters.name?html}" value=""<#rt/> <#if parameters.disabled?default(false)> disabled= "disabled" <#rt/> </#if> /> </#if>
        Hide
        nick.sree nick added a comment -

        Thanks for confirming it Bruce and Lukasz.

        Show
        nick.sree nick added a comment - Thanks for confirming it Bruce and Lukasz.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1509747 from Bruce Phillips in branch 'struts2/trunk'
        [ https://svn.apache.org/r1509747 ]

        WW-4153 added Freemarker markup to handle use case when multiple="true" attribute is included with s:select tag but no name or id attribute is provided.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1509747 from Bruce Phillips in branch 'struts2/trunk' [ https://svn.apache.org/r1509747 ] WW-4153 added Freemarker markup to handle use case when multiple="true" attribute is included with s:select tag but no name or id attribute is provided.
        Hide
        bphillips Bruce Phillips added a comment -

        Updated simple/select.ftl in struts2-core with markup to handle when s:select tag includes multiple=true but no id or name attribute is given. All tests pass and I tested the specific use case - no exception is generated.

        Show
        bphillips Bruce Phillips added a comment - Updated simple/select.ftl in struts2-core with markup to handle when s:select tag includes multiple=true but no id or name attribute is given. All tests pass and I tested the specific use case - no exception is generated.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Struts2-JDK6 #774 (See https://builds.apache.org/job/Struts2-JDK6/774/)
        WW-4153 added Freemarker markup to handle use case when multiple="true" attribute is included with s:select tag but no name or id attribute is provided. (bphillips: rev 1509747)

        • /struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Struts2-JDK6 #774 (See https://builds.apache.org/job/Struts2-JDK6/774/ ) WW-4153 added Freemarker markup to handle use case when multiple="true" attribute is included with s:select tag but no name or id attribute is provided. (bphillips: rev 1509747) /struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl
        Hide
        nick.sree nick added a comment -

        Thanks Bruce...

        Show
        nick.sree nick added a comment - Thanks Bruce...

          People

          • Assignee:
            bphillips Bruce Phillips
            Reporter:
            nick.sree nick
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development