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

<s:select tag has bag and doesnt allow to set me default value if the value is higer than 1000

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 2.0.6
    • 2.0.14
    • Core Actions, Plugin - Tags
    • None
    • Important

    Description

      Hello,

      I want to set a default value of the select box but it doesn't allows me to set the default value if i pass value higher than 1000.

      For batter understanding of this issue I have given example below so that you can understand it.

      EXAMPLE 1

      <%@ taglib prefix="s" uri="/struts-tags" %>

      <html>
      <head>
      <title>Select Tag Example</title>
      </head>
      <body>
      <h1><span style="background-color: #FFFFcc">Select Tag Example!</span></h>
      <s:form action="changeHeader">
      <s:select label="Select Month" name="month"
      list="#

      {'1021':'January', '1022':'February', '1023':'March', '1024':'April', '1025':'May', '1026':'June', '1027':'July', '1028':'August', '1029':'September', '1031':'October', '1032':'November', '9':'December'}

      " value="9"/>

      <s:submit value="default value"/>
      </s:form>
      </body>
      </html>

      For the above given example I have passed 9 as the value of the VALUE ATTRIBUTE, and hence it shows me 9 as the default value.

      EXAMPLE 2

      <%@ taglib prefix="s" uri="/struts-tags" %>

      <html>
      <head>
      <title>Select Tag Example</title>
      </head>
      <body>
      <h1><span style="background-color: #FFFFcc">Select Tag Example!</span></h>
      <s:form action="changeHeader">
      <s:select label="Select Month" name="month"
      list="#

      {'1021':'January', '1022':'February', '1023':'March', '1024':'April', '1025':'May', '1026':'June', '1027':'July', '1028':'August', '1029':'September', '1031':'October', '1032':'November', '1034':'December'}

      " value="1034"/>

      <s:submit value="default value"/>
      </s:form>
      </body>
      </html>

      in the above given example i have passed 1034 as the value of the VALUE ATTRIBUTE but this time it doesn't show me December as my default value for the list box because the value I have passed is higher than 1000 and hence it gives me error.

      Please provide me solution of this as because my project is in trouble because of this issue and moreover, I am not allowed to upgrade my struts version.

      However, as per my testing this is the problem with struts 2.0.6 and not with 2.0.14.

      Hope to receive answer as the earliest.

      Kind regards,

      Ashish

      Attachments

        Activity

          People

            Unassigned Unassigned
            ashish Ashish Vijaywargiya
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: