Issue Details (XML | Word | Printable)

Key: TRB-9
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Stefan Broetz
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Turbine

Intake: Handling of empty values

Created: 02/Mar/06 11:34 PM   Updated: 06/Jan/09 09:04 PM
Return to search
Component/s: Turbine 2.3
Affects Version/s: Core 2.3.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch_TRB-9.txt 2006-06-22 08:39 PM Jürgen Hoffmann 3 kB
Issue Links:
Reference
 

Resolution Date: 26/Jun/06 09:08 AM


 Description  « Hide
It seems to be impossible transmit the empty string as a value: In the HTTP request

  http://.../turbine/...?aaa=123&bbb=&ccc=456

the parameter bbb is ignored.

If you look at org.apache.turbine.services.intake.model.Field.init(ValueParser pp) you find:

        if (pp.containsKey(getKey()))
        {
            if (isDebugEnabled)
            {
                log.debug(name + ": Found our Key in the request, setting Value");
            }
            if (StringUtils.isNotEmpty(pp.getString(getKey())))
            {
                setFlag = true;
            }
            validate();
        }
        else if (pp.containsKey(getValueIfAbsent()) &&
                pp.getString(getValueIfAbsent()) != null)
        {
            pp.add(getKey(), pp.getString(getValueIfAbsent()));
            setFlag = true;
            validate();
        }

The StringUtils.isNotEmpty() condition (line 342) prevents that a field can take up the empty string as its value.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #417109 Mon Jun 26 02:09:01 UTC 2006 seade TRB-9: Intake was not handling empty values correctly.
Also, Intake now handles the case where the mapToObject does not map to all fields in the group.
Thanks to Jürgen Hoffmann for the patch.
Files Changed
MODIFY /jakarta/turbine/fulcrum/trunk/intake/xdocs/changes.xml
MODIFY /jakarta/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/model/Field.java

Repository Revision Date User Message
ASF #417111 Mon Jun 26 02:09:43 UTC 2006 seade TRB-9: Intake was not handling empty values correctly.
Also, Intake now handles the case where the mapToObject does not map to all fields in the group.
Thanks to Jürgen Hoffmann for the patch.
Files Changed
MODIFY /jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/xdocs/changes.xml
MODIFY /jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turbine/services/intake/model/Field.java