Class ResponseHighlighterInterceptor
- java.lang.Object
-
- ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor
-
public class ResponseHighlighterInterceptor extends Object
This interceptor detects when a request is coming from a browser, and automatically returns a response with syntax highlighted (coloured) HTML for the response instead of just returning raw XML/JSON.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAM_RAWTODO: As of HAPI 1.6 (2016-06-10) this parameter has been replaced with simply requesting _format=json or xml so eventually this parameter should be removedstatic StringPARAM_RAW_TRUEstatic StringPARAM_TRUE
-
Constructor Summary
Constructors Constructor Description ResponseHighlighterInterceptor()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandleException(RequestDetails theRequestDetails, ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException theException, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse)booleanisShowRequestHeaders()If set totrue(default isfalse) response will include the request headersbooleanisShowResponseHeaders()If set totrue(default istrue) response will include the response headersbooleanoutgoingGraphqlResponse(RequestDetails theRequestDetails, String theRequest, String theResponse, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse)booleanoutgoingResponse(RequestDetails theRequestDetails, ResponseDetails theResponseObject, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse)ResponseHighlighterInterceptorsetShowRequestHeaders(boolean theShowRequestHeaders)If set totrue(default isfalse) response will include the request headersResponseHighlighterInterceptorsetShowResponseHeaders(boolean theShowResponseHeaders)If set totrue(default istrue) response will include the response headers
-
-
-
Field Detail
-
PARAM_RAW
public static final String PARAM_RAW
TODO: As of HAPI 1.6 (2016-06-10) this parameter has been replaced with simply requesting _format=json or xml so eventually this parameter should be removed- See Also:
- Constant Field Values
-
PARAM_RAW_TRUE
public static final String PARAM_RAW_TRUE
- See Also:
- Constant Field Values
-
PARAM_TRUE
public static final String PARAM_TRUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResponseHighlighterInterceptor
public ResponseHighlighterInterceptor()
Constructor
-
-
Method Detail
-
handleException
public boolean handleException(RequestDetails theRequestDetails, ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException theException, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse)
-
isShowRequestHeaders
public boolean isShowRequestHeaders()
If set totrue(default isfalse) response will include the request headers
-
setShowRequestHeaders
public ResponseHighlighterInterceptor setShowRequestHeaders(boolean theShowRequestHeaders)
If set totrue(default isfalse) response will include the request headers- Returns:
- Returns a reference to this for easy method chaining
-
isShowResponseHeaders
public boolean isShowResponseHeaders()
If set totrue(default istrue) response will include the response headers
-
setShowResponseHeaders
public ResponseHighlighterInterceptor setShowResponseHeaders(boolean theShowResponseHeaders)
If set totrue(default istrue) response will include the response headers- Returns:
- Returns a reference to this for easy method chaining
-
outgoingGraphqlResponse
public boolean outgoingGraphqlResponse(RequestDetails theRequestDetails, String theRequest, String theResponse, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse) throws ca.uhn.fhir.rest.server.exceptions.AuthenticationException
- Throws:
ca.uhn.fhir.rest.server.exceptions.AuthenticationException
-
outgoingResponse
public boolean outgoingResponse(RequestDetails theRequestDetails, ResponseDetails theResponseObject, javax.servlet.http.HttpServletRequest theServletRequest, javax.servlet.http.HttpServletResponse theServletResponse) throws ca.uhn.fhir.rest.server.exceptions.AuthenticationException
- Throws:
ca.uhn.fhir.rest.server.exceptions.AuthenticationException
-
-