com.HybridServerPages
Class Base_PS

java.lang.Object
  extended by com.HybridServerPages.Base_PS0
      extended by com.HybridServerPages.Base_PS

public class Base_PS
extends com.HybridServerPages.Base_PS0

Derive page state classes from this class


Field Summary
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
protected  javax.servlet.http.HttpSession session
           
 
Constructor Summary
protected Base_PS()
           
 
Method Summary
protected  void $accept(int code, java.lang.String msg, java.lang.Object more, Base_WS source)
          Override this method to get signals from sub-components.
protected  void $badActionCode()
          Call it if h1 part of HJ_Action is not recognized
protected  Base_AS $getAS()
          Access to Application State instance
protected  Base_PS $getPageInstance(java.lang.String pn)
          Access to state instance of any page by name
protected  java.lang.String $getParam(java.lang.String name, java.lang.String prev)
          Access to page-related HTTP request parameters
protected  void $handlePage(java.lang.String h1, java.lang.String h2)
          Override this method to process HTTP request
protected  void $postDraw()
          Override this metod to do something right after sending the HTTP response
protected  void $preDraw()
          Override this metod to do something right before sending the HTTP response
protected  void $setBadParam(java.lang.String name, java.lang.String msg)
          Marks the parameter as bad
protected  boolean $setNextPage(java.lang.String pn)
          Sets the next page to be shown.
protected  void $setReturn()
          Sets the next page equal to the page you came here from.
protected  java.lang.String badParam(java.lang.String name, java.lang.String id)
          returns message if the parameter did not pass validation
protected  Base_WS getComponent(java.lang.String id)
          Access to current component from widget, call it as getComponent($#)
protected  java.lang.String getPageName()
          Name of the currently processed page
 
Methods inherited from class com.HybridServerPages.Base_PS0
$a, $accept, $DR, $get_$DR2, $get_$SH2, $get_$SI2, $get_$SL2, $get_$SR2, $getBadParams, $getFrom, $getObj, $getPageId, $I, $isLoaded, $R, $render, $set_$DR2, $set_$SH2, $set_$SI2, $set_$SL2, $set_$SR2, $setFrom, $setLoaded, $SH, $SI, $SL, $SR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

session

protected javax.servlet.http.HttpSession session
Constructor Detail

Base_PS

protected Base_PS()
Method Detail

$accept

protected void $accept(int code,
                       java.lang.String msg,
                       java.lang.Object more,
                       Base_WS source)
Override this method to get signals from sub-components. Otherwise the signal will be propagated up

Parameters:
code - some value
msg - some message
more - some additional data
source - the component that fired the signal

$getPageInstance

protected final Base_PS $getPageInstance(java.lang.String pn)
Access to state instance of any page by name

Parameters:
pn - name of the page in the form of a Java class name
Returns:
page state instance

$preDraw

protected void $preDraw()
Override this metod to do something right before sending the HTTP response

Overrides:
$preDraw in class com.HybridServerPages.Base_PS0

$postDraw

protected void $postDraw()
Override this metod to do something right after sending the HTTP response

Overrides:
$postDraw in class com.HybridServerPages.Base_PS0

$handlePage

protected void $handlePage(java.lang.String h1,
                           java.lang.String h2)
Override this method to process HTTP request

Overrides:
$handlePage in class com.HybridServerPages.Base_PS0
Parameters:
h1 - first (name) part (before ':') of HJ_Action HTTP parameter
h2 - second (value) part of HJ_Action HTTP parameter Note: Using the HJ_Action is optional as HTTP request is always available

$badActionCode

protected final void $badActionCode()
Call it if h1 part of HJ_Action is not recognized


$getAS

protected final Base_AS $getAS()
Access to Application State instance

Returns:
Application State instance if you've provided AS.java class

getPageName

protected java.lang.String getPageName()
Name of the currently processed page

Overrides:
getPageName in class com.HybridServerPages.Base_PS0
Returns:
the name of the current page

$setNextPage

protected final boolean $setNextPage(java.lang.String pn)
Sets the next page to be shown. If called more than once the last call effective

Overrides:
$setNextPage in class com.HybridServerPages.Base_PS0
Parameters:
pn - name of the page a.k.a. full class name of the page
Returns:
false for all calls except the first one

$setReturn

protected final void $setReturn()
Sets the next page equal to the page you came here from. This is a support for back button


badParam

protected final java.lang.String badParam(java.lang.String name,
                                          java.lang.String id)
returns message if the parameter did not pass validation

Parameters:
name - of the parameter
id - id of component
Returns:
msg message to be shown at the control

$setBadParam

protected final void $setBadParam(java.lang.String name,
                                  java.lang.String msg)
Marks the parameter as bad

Parameters:
name - of the parameter that did not pass validation
msg - message to be shown at the control

$getParam

protected final java.lang.String $getParam(java.lang.String name,
                                           java.lang.String prev)
Access to page-related HTTP request parameters

Parameters:
name - component-scope name of the parameter
prev - value returned if no such parameter in the current HTTP request. null is OK
Returns:
parameter value.

getComponent

protected final Base_WS getComponent(java.lang.String id)
Access to current component from widget, call it as getComponent($#)

Parameters:
id - id of the component
Returns:
Instance of the component; null for page