Package ortus.boxlang.web.bifs
Class GetPageContext.PageContext
java.lang.Object
ortus.boxlang.web.bifs.GetPageContext.PageContext
- Enclosing class:
GetPageContext
Fake PageContext class to provide common methods since we are NOT in a servlet container
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a response header to the response.voidClears the response buffer, if any, and resets the response status code and headers.Alias for getRequestHeader - for compatgetOut()Returns the current PageContext object.Returns the current request object.getRequestHeader(String name) Returns the value of the specified request header as a String.Returns a map of all the request headers.Returns the request URL as a StringBuffer.Returns the current context object.getResponseHeader(String name) Returns the value of the specified response header as a String.Returns a map of all the response headers.intReturns the current response status code.booleanReturns a boolean indicating if the response has been committed.voidreset()Clears the response buffer, if any, and resets the response status code and headers.voidClears the response buffer, if any, and resets the response status code and headers.voidsetContentType(String value) Sets the response content type header.voidSets a response header.voidsetStatus(int code) Sets the response status code.voidSets the response status code and message.voidvoid
-
Constructor Details
-
PageContext
public PageContext(ortus.boxlang.runtime.context.IBoxContext context)
-
-
Method Details
-
getResponse
Returns the current context object. This method is provided for backward compatibility- Returns:
-
getRequest
Returns the current request object. This method is provided for backward compatibility- Returns:
-
setHeader
Sets a response header. If the response has already been started, this method does nothing.- Parameters:
name-value-
-
setContentType
Sets the response content type header. If the response has already been started, this method does nothing.- Parameters:
value-
-
setStatus
-
setStatus
-
setStatus
Sets the response status code and message. If the response has already been started, this method does nothing.- Parameters:
code-text-
-
setStatus
public void setStatus(int code) Sets the response status code.- Parameters:
code-
-
getStatus
public int getStatus()Returns the current response status code. This method is provided for backward compatibility- Returns:
-
reset
public void reset()Clears the response buffer, if any, and resets the response status code and headers. -
clearBuffer
public void clearBuffer()Clears the response buffer, if any, and resets the response status code and headers. This method is provided for backward compatibility -
resetHTMLHead
public void resetHTMLHead()Clears the response buffer, if any, and resets the response status code and headers. -
getOut
Returns the current PageContext object. This method is provided for backward compatibility- Returns:
-
hasFamily
-
getRequestURL
Returns the request URL as a StringBuffer. This is the full URL- Returns:
-
getContentType
-
addHeader
Adds a response header to the response. If the response has already been committed, this method does nothing.- Parameters:
name-value-
-
getResponseHeaderMap
Returns a map of all the response headers.- Returns:
-
getResponseHeader
Returns the value of the specified response header as a String.- Parameters:
name-- Returns:
-
getRequestHeaderMap
Returns a map of all the request headers.- Returns:
-
getRequestHeader
Returns the value of the specified request header as a String.- Parameters:
name-- Returns:
-
getHeader
Alias for getRequestHeader - for compat- Parameters:
name-- Returns:
-
isCommitted
public boolean isCommitted()Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.- Returns:
- a boolean indicating if the response has been committed
-