    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.forms.PostableResource

    java.lang.Object
       |
       +----w3c.jigsaw.resources.AttributeHolder
               |
               +----w3c.jigsaw.resources.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

##

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

##

PostableResource()

##

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

##

ATTR_OVERIDE

      protected static int ATTR_OVERIDE

  Attribute index - Should we override form values when multiple ?

ATTR_CONVERT_GET

      protected static int ATTR_CONVERT_GET

  Attribute index - Should we silently convert GET to POST methods ?

##

PostableResource

      public PostableResource()

##

getConvertGetFlag

      public boolean getConvertGetFlag()

  Get the 'convert GET to POST' flag.

getOverrideFlag

      public boolean getOverrideFlag()

  Get the 'override multiple form field value' flag.

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

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

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

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