All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.jigsaw.ssi.SSIFrame

java.lang.Object
   |
   +----org.w3c.tools.resources.AttributeHolder
           |
           +----org.w3c.tools.resources.Resource
                   |
                   +----org.w3c.tools.resources.FramedResource
                           |
                           +----org.w3c.tools.resources.ResourceFrame
                                   |
                                   +----org.w3c.tools.resources.ProtocolFrame
                                           |
                                           +----org.w3c.jigsaw.frames.HTTPFrame
                                                   |
                                                   +----org.w3c.jigsaw.ssi.SSIFrame

public class SSIFrame
extends HTTPFrame
This resource implements server-side parsing of HTML documents. Any comment of the form <!--#commandName param1=val1 ... paramn=valn --> will be interpreted as an include directive.

Commands are looked up in an instance of the class supplied in the registryClass attribute, which must be a subclass of org.w3c.jigsaw.ssi.CommandRegistry.

See Also:
CommandRegistry, Command

Variable Index

 o debug
 o STATE_DEPTH
Message state - the current recursion depth
 o STATE_VARIABLES
Message state - the current variables
 o vars
Our "very global" variables

Constructor Index

 o SSIFrame()

Method Index

 o attributeChanged(AttributeChangedEvent)
Listen its resource.
 o byteArrayNEquals(byte[], int, byte[], int, int)
Analogous to standard C's strncmp, for byte arrays.
 o createCommandReply(Request, int)
 o createDefaultReply(Request, int)
Create a reply to answer to request on this file.
 o getFileResource(Request)
Perform a get (associated with a FileResource)
 o getLastModified()
Get this resource last modification time.
 o handle(Request)
Handles all relevant HTTP methods.
 o perform(RequestInterface)
Makes sure that checkContent() is called on _any_ HTTP method, so that the internal representation of commands is always consistent.
 o post(Request)
Perform a post.

Variables

 o debug
 public static final boolean debug
 o vars
 protected Dictionary vars
Our "very global" variables

 o STATE_DEPTH
 public static final String STATE_DEPTH
Message state - the current recursion depth

 o STATE_VARIABLES
 public static final String STATE_VARIABLES
Message state - the current variables

Constructors

 o SSIFrame
 public SSIFrame()

Methods

 o attributeChanged
 public void attributeChanged(AttributeChangedEvent evt)
Listen its resource.

Overrides:
attributeChanged in class HTTPFrame
 o perform
 public ReplyInterface perform(RequestInterface request) throws ProtocolException, ResourceException
Makes sure that checkContent() is called on _any_ HTTP method, so that the internal representation of commands is always consistent.

Parameters:
request - The HTTPRequest
filters - The filters to apply
Returns:
a ReplyInterface instance
Throws: ProtocolException
If processing the request failed.
Throws: ResourceException
If this resource got a fatal error.
Overrides:
perform in class HTTPFrame
 o getFileResource
 protected Reply getFileResource(Request request) throws ProtocolException, ResourceException
Perform a get (associated with a FileResource)

Parameters:
request - the HTTP request
Returns:
a Reply instance.
Throws: ProtocolException
If processing the request failed.
Throws: ResourceException
If this resource got a fatal error.
Overrides:
getFileResource in class HTTPFrame
 o post
 public Reply post(Request request) throws ProtocolException, ResourceException
Perform a post.

Parameters:
request - the HTTP request
Returns:
a Reply instance.
Throws: ProtocolException
If processing the request failed.
Throws: ResourceException
If this resource got a fatal error.
Overrides:
post in class HTTPFrame
 o handle
 public Reply handle(Request request) throws ProtocolException
Handles all relevant HTTP methods. Merges the partial replies from each of the segments into one global reply. Remark: no direct relation to PostableResource.handle()

Parameters:
request - The HTTP request
Returns:
a Reply instance.
Throws: ProtocolException
If processing the request failed.
 o byteArrayNEquals
 public static final boolean byteArrayNEquals(byte ba1[],
                                              int off1,
                                              byte ba2[],
                                              int off2,
                                              int n)
Analogous to standard C's strncmp, for byte arrays. (Should be in some utility package, I'll put it here for now)

Parameters:
ba1 - the first byte array
off1 - where to start in the first array
ba2 - the second byte array
off2 - where to start in the second array
n - the length to compare up to
Returns:
true if both specified parts of the arrays are equal, false if they aren't .
 o getLastModified
 public long getLastModified()
Get this resource last modification time.

Overrides:
getLastModified in class Resource
 o createDefaultReply
 public final Reply createDefaultReply(Request request,
                                       int status)
Create a reply to answer to request on this file.

Overrides:
createDefaultReply in class HTTPFrame
 o createCommandReply
 public final Reply createCommandReply(Request request,
                                       int status)

All Packages  Class Hierarchy  This Package  Previous  Next  Index