public void setDateHeader ( String name , long t ) { // 311717 if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { //306998.15 logger . entering ( CLASS_NAME , "setDateHeader" , " name --> " + name + " value --> " + String . valueOf ( t ) + " [" + this + "]" ) ; } // d151464 - check the include flag WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) getRequest ( ) . getWebAppDispatcherContext ( ) ; if ( dispatchContext . isInclude ( ) == true ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { //306998.15 logger . logp ( Level . FINE , CLASS_NAME , "setDateHeader" , nls . getString ( "Illegal.from.included.servlet" , "Illegal from included servlet" ) ) ; //311717 } } else { // d128646 - if we're not ignoring state errors and response is committed or closed, throw an exception if ( ! _ignoreStateErrors && isCommitted ( ) ) { // log a warning (only the first time)...ignore headers set after response is committed IServletWrapper wrapper = dispatchContext . getCurrentServletReference ( ) ; if ( logWarningActionNow ( wrapper ) ) { logAlreadyCommittedWarning ( new Throwable ( ) , "setDateHeader" ) ; } else { logger . logp ( Level . FINE , CLASS_NAME , "setDateHeader" , "Cannot set header. Response already committed." ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { //306998.15 logger . exiting ( CLASS_NAME , "setDateHeader" , "Response already committed" ) ; } return ; } // _header.setDateField(name, t); _response . setDateHeader ( name , t ) ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { //306998.15 logger . exiting ( CLASS_NAME , "setDateHeader" ) ; } }
Adds a date header with the specified time . If this is called more than once the current value will replace the previous value .