Class ModelAsJsonRequestHandler
java.lang.Object
ro.isdc.wro.http.handler.RequestHandlerSupport
ro.isdc.wro.extensions.http.handler.ModelAsJsonRequestHandler
- All Implemented Interfaces:
RequestHandler
Expose the
WroModel as JSON when the following uri is accessed: "wroAPI/model". This RequestHandler
is useful to inspect the model and to simulate the behavior of the page when all resources are included (one by one)
without being merged.- Since:
- 1.4.7
- Author:
- Alex Objelean, Ivar Conradi Ă˜sthus
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe alias of thisRequestHandlerused for configuration.static final StringAPI - reload cache method callFields inherited from class ro.isdc.wro.http.handler.RequestHandlerSupport
PATH_API -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(jakarta.servlet.http.HttpServletRequest request) voidhandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) booleanprotected com.google.gson.GsonnewGson(jakarta.servlet.http.HttpServletRequest request)
-
Field Details
-
ENDPOINT_URI
API - reload cache method call- See Also:
-
ALIAS
The alias of thisRequestHandlerused for configuration.- See Also:
-
-
Constructor Details
-
ModelAsJsonRequestHandler
public ModelAsJsonRequestHandler()
-
-
Method Details
-
handle
public void handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException - Specified by:
handlein interfaceRequestHandler- Overrides:
handlein classRequestHandlerSupport- Throws:
IOException
-
newGson
protected com.google.gson.Gson newGson(jakarta.servlet.http.HttpServletRequest request) - Returns:
- customized
Gsoninstance.
-
accept
public boolean accept(jakarta.servlet.http.HttpServletRequest request) - Specified by:
acceptin interfaceRequestHandler- Overrides:
acceptin classRequestHandlerSupport
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceRequestHandler- Overrides:
isEnabledin classRequestHandlerSupport
-