org.springframework.extensions.webscripts
Class ScriptFormData

java.lang.Object
  extended by org.springframework.extensions.webscripts.ScriptBase
      extended by org.springframework.extensions.webscripts.ScriptFormData
All Implemented Interfaces:
Serializable

public final class ScriptFormData
extends ScriptBase

Represents form data that was posted back to the current rendering context. Form data can arrive via a multipart form post or via a urlencoded form post. This object disambiguates between the two and provides a common interface for working with form-posted variables. It takes into account namespacing of form variables.

Author:
muzquiano
See Also:
Serialized Form

Nested Class Summary
 class ScriptFormData.FormField
           
 
Field Summary
 
Fields inherited from class org.springframework.extensions.webscripts.ScriptBase
context, properties
 
Constructor Summary
ScriptFormData(RenderContext context)
          Instantiates a new script form.
 
Method Summary
protected  ScriptableMap buildProperties()
           
 ScriptFormData.FormField getField(String id)
          Gets an element form field.
 String[] getFieldIds()
          Gets the ids of all element form fields.
 Object[] getFields()
          Gets the fields.
 void load(String prefix)
          Populates the object with form bindings for the given namespace
protected  void processMapIntoFields(Map map, String prefix)
          Converts a map of name/value pairs into fields if they match the specified prefix
 
Methods inherited from class org.springframework.extensions.webscripts.ScriptBase
getConfig, getModel, getObject, getProperties, getRequestContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptFormData

public ScriptFormData(RenderContext context)
Instantiates a new script form.

Parameters:
rendererContext - the renderer context
Method Detail

buildProperties

protected ScriptableMap buildProperties()
Specified by:
buildProperties in class ScriptBase

getField

public ScriptFormData.FormField getField(String id)
Gets an element form field.

Parameters:
id - the id
Returns:
the binding

getFields

public Object[] getFields()
Gets the fields.

Returns:
the fields

getFieldIds

public String[] getFieldIds()
Gets the ids of all element form fields.

Returns:
the field ids

load

public void load(String prefix)
Populates the object with form bindings for the given namespace


processMapIntoFields

protected void processMapIntoFields(Map map,
                                    String prefix)
Converts a map of name/value pairs into fields if they match the specified prefix

Parameters:
map -
prefix -


Copyright © 2009 SpringSource, Inc. All Rights Reserved.