struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38208] New: - Should an attribute add to <bean:write/> tag for ellipsis?
Date Tue, 10 Jan 2006 03:34:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38208>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38208

           Summary: Should an attribute add to <bean:write/> tag for
                    ellipsis?
           Product: Struts
           Version: 1.2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Taglibs
        AssignedTo: dev@struts.apache.org
        ReportedBy: truncatei@gmail.com


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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message