org.japano
Class Page

java.lang.Object
  extended by org.japano.PageNode
      extended by org.japano.Page
Direct Known Subclasses:
PageGenerator.ErrorPage

public class Page
extends PageNode

Base class for all japano JSP pages.

Version:
$Id: Page.java,v 1.22 2005/12/14 06:34:10 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )

Nested Class Summary
 
Nested classes/interfaces inherited from class org.japano.PageNode
PageNode.Output
 
Field Summary
protected  javax.servlet.ServletContext application
           
protected  JapanoConfig config
           
protected  java.lang.String contentType
           
protected  java.lang.String errorPageURI
           
protected  Buffer out
           
protected  javax.servlet.jsp.PageContext pageContext
           
protected  java.util.List postGenerate
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
protected  Session session
           
 
Fields inherited from class org.japano.PageNode
children, context, EMPTY, nodeId, parent
 
Constructor Summary
Page()
           
 
Method Summary
 void _jspService(Buffer out, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Jsp Service method
 void addNode(PageNode node)
          Adds a node to this page.
 void clearAttributes()
           
 void generate(Buffer out)
          Generates this node The base implementation just calls PageNode.generateChildren(Buffer)
 java.lang.Object getAttribute(java.lang.String str)
           
 java.util.Enumeration getAttributeNames()
           
 java.lang.String getErrorPageURI()
           
 java.util.List getMessages()
          Returns all available messages and removes them from the page.
 java.util.List getMessagesFor(java.lang.Class actionClass)
          Returns all available messages for the given action class and removes them from the page.
 void init()
          Initializes the node.
 void initScope(java.util.Map attributes)
           
 void part(java.lang.String id, Buffer out, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void register(java.lang.String id, PageNode node)
           
 void release()
          Always called at the end of a page invocation.
 void removeAttribute(java.lang.String str)
           
 void replace(java.lang.Object child, java.lang.Object replacement)
          Replaces a child instance with another instance.
 void setAttribute(java.lang.String str, java.lang.Object obj)
           
 void setContext(Context context)
           
 
Methods inherited from class org.japano.PageNode
findChildren, findParent, findRootNode, generateChildren, getChildren, getContext, getNodeId, getParent, recInit, setChildren, setContext, setNodeId, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageContext

protected javax.servlet.jsp.PageContext pageContext

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

application

protected javax.servlet.ServletContext application

config

protected JapanoConfig config

out

protected Buffer out

session

protected Session session

contentType

protected java.lang.String contentType

postGenerate

protected java.util.List postGenerate

errorPageURI

protected java.lang.String errorPageURI
Constructor Detail

Page

public Page()
Method Detail

initScope

public void initScope(java.util.Map attributes)

setContext

public void setContext(Context context)

_jspService

public void _jspService(Buffer out,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.jsp.JspException,
                        java.io.IOException
Jsp Service method

Parameters:
request - HttpServletRequest
response - HttpServletResponse
Throws:
ServletException
java.io.IOException
javax.servlet.jsp.JspException

part

public void part(java.lang.String id,
                 Buffer out,
                 javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response)
          throws javax.servlet.jsp.JspException,
                 java.io.IOException
Throws:
javax.servlet.jsp.JspException
java.io.IOException

getAttribute

public java.lang.Object getAttribute(java.lang.String str)

removeAttribute

public void removeAttribute(java.lang.String str)

setAttribute

public void setAttribute(java.lang.String str,
                         java.lang.Object obj)

getAttributeNames

public java.util.Enumeration getAttributeNames()

clearAttributes

public void clearAttributes()

register

public void register(java.lang.String id,
                     PageNode node)

getMessages

public java.util.List getMessages()
Returns all available messages and removes them from the page.


getMessagesFor

public java.util.List getMessagesFor(java.lang.Class actionClass)
Returns all available messages for the given action class and removes them from the page.

Parameters:
actionClass - type of the action

addNode

public void addNode(PageNode node)
Adds a node to this page. Nodes added to the page are generated after the page in the order in which they were added.

Parameters:
node - node

getErrorPageURI

public java.lang.String getErrorPageURI()

init

public void init()
Description copied from class: PageNode
Initializes the node. The init method is called after all nodes of the page are constructed, linked and configured.

Overrides:
init in class PageNode

generate

public void generate(Buffer out)
Description copied from class: PageNode
Generates this node The base implementation just calls PageNode.generateChildren(Buffer)

Overrides:
generate in class PageNode

replace

public void replace(java.lang.Object child,
                    java.lang.Object replacement)
Replaces a child instance with another instance.

Parameters:
child - the child to be replaced.
replacement - the child to replace the former with.

release

public void release()
Description copied from class: PageNode
Always called at the end of a page invocation.

Overrides:
release in class PageNode