Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2725

Should an attribute add to <bean:write/> tag for ellipsis?

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.7
    • Fix Version/s: Future
    • Component/s: Tag Libraries
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • Bugzilla Id:
      38208

      Description

      In WriteTag.java
      // ......
      // initial=0
      protected int abbreviate = 0;

      public int getAbbreviate()

      { return abbreviate; }

      public void setAbbreviate(int abbreviate)

      { this.abbreviate = abbreviate; }

      // ......
      public int doStartTag() throws JspException {
      // ...
      if (abbreviate > 0)

      { // if greater than 0(default if not set in <bean:wrire/>) output = StringUtils.abbreviate(output, abbreviate); }

      // Print this property value to our output writer, suitably filtered
      if (filter) {
      //...
      }

      And the tag:
      <attribute>
      <name>abbreviate</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
      </attribute>

      Then we can use <bean:write name="somename" abbreviate="length(int)"/> for
      short text we want.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                truncatei Chen Lei
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: