You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/09/25 13:02:06 UTC

DO NOT REPLY [Bug 23407] New: - ActionMessages toString() method desirable

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23407>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23407

ActionMessages toString() method desirable

           Summary: ActionMessages toString() method desirable
           Product: Struts
           Version: Unknown
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Unknown
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: adam.hardy@cyberspaceroad.com


This would make logging easier. 

In ActionMessages:

    /**
     * @return string representation of the object
     */
    public String toString() {

        StringBuffer buff = new StringBuffer();
        
        for (Iterator i = messages.values().iterator(); i.hasNext();) {
            ActionMessageItem ami = (ActionMessageItem) i.next();
            buff.append(ami.getList());
        }

        return buff.toString();

    }


In ActionMessage:
    /**
     * @return string representation of this message
     */
    public String toString()
    {
        return this.key;
    }

I am slightly dubious about the effects this would have on serialization in a
distributed environment, since I have no experience with that. It seems to me
that the "implements Serializable" on these classes has no other effect than
allowing it to be placed in the session when the appserver is enforcing
distributability.

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