cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35651] New: - [PATCH] SetterAction and session setting
Date Thu, 07 Jul 2005 16:16:16 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=35651>.
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=35651

           Summary: [PATCH] SetterAction and session setting
           Product: Cocoon 2
           Version: Current SVN 2.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general components
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: joose@iki.fi


I was reading some codes from svn and saw an error in SetterAction.

Current code:

        for(int i = 0; i < names.length; i++) {
            final String name = names[i];
            if ( this.mode == MODE_OBJECT_MODEL ) {
                objectModel.put(name, parameters.getParameter(name));                
            } else if ( this.mode == MODE_REQUEST_ATTR ) {
                ObjectModelHelper.getRequest(objectModel).setAttribute(name, parameters.getParameter
(name));                
            } else if ( this.mode == MODE_REQUEST_ATTR ) {
                ObjectModelHelper.getRequest(objectModel).getSession().setAttribute(name,

parameters.getParameter(name));                
            }
        }
        return EMPTY_MAP;

Should be:
        for(int i = 0; i < names.length; i++) {
            final String name = names[i];
            if ( this.mode == MODE_OBJECT_MODEL ) {
                objectModel.put(name, parameters.getParameter(name));                
            } else if ( this.mode == MODE_REQUEST_ATTR ) {
                ObjectModelHelper.getRequest(objectModel).setAttribute(name, parameters.getParameter
(name));                
            } else if ( this.mode == MODE_SESSION_ATTR ) { // <- here is the change
                ObjectModelHelper.getRequest(objectModel).getSession().setAttribute(name,

parameters.getParameter(name));                
            }
        }
        return EMPTY_MAP;

...

That last if's MODE_REQUEST_ATTR should be MODE_SESSION_ATTR

-- 
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.

Mime
View raw message