All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.forms.PostableResource

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.jigsaw.resources.HTTPResource
                           |
                           +----w3c.jigsaw.resources.FilteredResource
                                   |
                                   +----w3c.jigsaw.resources.FileResource
                                           |
                                           +----w3c.jigsaw.forms.PostableResource

public class PostableResource
extends FileResource
This class is the root class for handling forms inside the server. It will decode the form content, and trigger a call to the handle method of the instance.

It inherits from the FileResource class to be able to send the form text, and extends it with an implementation of the post method.

See Also:
FileResource

Variable Index

 o ATTR_CONVERT_GET
Attribute index - Should we silently convert GET to POST methods ?
 o ATTR_OVERIDE
Attribute index - Should we override form values when multiple ?

Constructor Index

 o PostableResource()

Method Index

 o get(Request)
Get this resource body.
 o getConvertGetFlag()
Get the 'convert GET to POST' flag.
 o getOverrideFlag()
Get the 'override multiple form field value' flag.
 o handle(Request, URLDecoder)
Handle the form submission, after posted data parsing.
 o initialize(Object[])
Setup the list of allowed methods.
 o post(Request)
The POST method handling.
 o verify()
The verify method of a postable resource will always return false.

Variables

 o ATTR_OVERIDE
 protected static int ATTR_OVERIDE
Attribute index - Should we override form values when multiple ?

 o ATTR_CONVERT_GET
 protected static int ATTR_CONVERT_GET
Attribute index - Should we silently convert GET to POST methods ?

Constructors

 o PostableResource
 public PostableResource()

Methods

 o getConvertGetFlag
 public boolean getConvertGetFlag()
Get the 'convert GET to POST' flag.

 o getOverrideFlag
 public boolean getOverrideFlag()
Get the 'override multiple form field value' flag.

 o get
 public Reply get(Request request) throws HTTPException
Get this resource body. If we are allowed to convert GET requests to POST, than we first check to see if there is some search string in the request, and continue with normal POST request processing.

If there is no search string, or if we are not allowed to convert GETs to POSTs, than we just invoke our super method, which will perform the appropriate job.

Parameters:
request - The request to handle.
Throws: HTTPException
If request couldn't be processed.
Overrides:
get in class FileResource
 o post
 public Reply post(Request request) throws HTTPException, ClientException
The POST method handling. This method decode the posted data, and triggers a call to the handle method.

Parameters:
request - The request to handle.
Throws: HTTPException
If request processing failed.
Overrides:
post in class HTTPResource
 o handle
 public Reply handle(Request request,
                     URLDecoder data) throws HTTPException
Handle the form submission, after posted data parsing.

This method ought to be abstract, but for reasonable reason, it will just dump (parsed) the form content back to the client, so that it can be used for debugging.

Parameters:
request - The request proper.
data - The parsed data content.
Throws: HTTPException
If form data processing failed.
See Also:
URLDecoder
 o verify
 public boolean verify()
The verify method of a postable resource will always return false. Any PostableResource has to be removed manually.

Returns:
Always false.
Overrides:
verify in class FileResource
 o initialize
 public void initialize(Object values[])
Setup the list of allowed methods.

Overrides:
initialize in class FileResource

All Packages  Class Hierarchy  This Package  Previous  Next  Index