public void replaceHeader(int state,String header) throws AuthLoginException {
  if (debug.messageEnabled()) {
    debug.message("ReplaceHeader : state=" + state + ", header="+ header);
  }
  if (lastState != state) {
    alreadyReplaced=false;
  }
  lastState=state;
  if (state > stateLength) {
    throw new AuthLoginException(bundleName,"invalidState",new Object[]{new Integer(state)});
  }
  Callback[] ext=getCallback(state,true);
  if (ext.length <= 0) {
    throw new AuthLoginException(bundleName,"invalidCallbackIndex",null);
  }
  if ((header != null) && (header.length() != 0)) {
    PagePropertiesCallback pc=(PagePropertiesCallback)((Callback[])internal.get(state - 1))[0];
    if (!(alreadyReplaced)) {
      headerWithReplaceTag=pc.getHeader();
    }
    int idx=headerWithReplaceTag.indexOf("#REPLACE#");
    if (idx != -1) {
      String newHeader=headerWithReplaceTag.substring(0,idx) + header;
      pc.setHeader(newHeader);
      alreadyReplaced=true;
    }
 else {
      String newHeader=headerWithReplaceTag.substring(0,headerWithReplaceTag.indexOf("<BR></BR>")) + "<BR></BR>" + header;
      pc.setHeader(newHeader);
    }
  }
}

public void replaceHeader ( int state , String header ) throws AuthLoginException { if ( debug . messageEnabled ( ) ) { debug . message ( "ReplaceHeader : state=" + state + ", header=" + header ) ; } if ( lastState != state ) { alreadyReplaced = false ; } lastState = state ; if ( state > stateLength ) { throw new AuthLoginException ( bundleName , "invalidState" , new Object [ ] { new Integer ( state ) } ) ; } Callback [ ] ext = getCallback ( state , true ) ; if ( ext . length <= 0 ) { throw new AuthLoginException ( bundleName , "invalidCallbackIndex" , null ) ; } if ( ( header != null ) && ( header . length ( ) != 0 ) ) { PagePropertiesCallback pc = ( PagePropertiesCallback ) ( ( Callback [ ] ) internal . get ( state - 1 ) ) [ 0 ] ; if ( ! ( alreadyReplaced ) ) { headerWithReplaceTag = pc . getHeader ( ) ; } int idx = headerWithReplaceTag . indexOf ( "#REPLACE#" ) ; if ( idx != - 1 ) { String newHeader = headerWithReplaceTag . substring ( 0 , idx ) + header ; pc . setHeader ( newHeader ) ; alreadyReplaced = true ; } else { String newHeader = headerWithReplaceTag . substring ( 0 , headerWithReplaceTag . indexOf ( "<BR></BR>" ) ) + "<BR></BR>" + header ; pc . setHeader ( newHeader ) ; } } }
replace page header for a specific state .
