ro.isdc.wro.extensions.http.handler
Class ModelAsJsonRequestHandler
java.lang.Object
ro.isdc.wro.http.handler.RequestHandlerSupport
ro.isdc.wro.extensions.http.handler.ModelAsJsonRequestHandler
- All Implemented Interfaces:
- RequestHandler
public class ModelAsJsonRequestHandler
- extends RequestHandlerSupport
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
|
Method Summary |
boolean |
accept(javax.servlet.http.HttpServletRequest request)
|
void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
boolean |
isEnabled()
|
protected com.google.gson.Gson |
newGson(javax.servlet.http.HttpServletRequest request)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENDPOINT_URI
public static final String ENDPOINT_URI
- API - reload cache method call
- See Also:
- Constant Field Values
ALIAS
public static final String ALIAS
- The alias of this
RequestHandler used for configuration.
- See Also:
- Constant Field Values
ModelAsJsonRequestHandler
public ModelAsJsonRequestHandler()
handle
public void handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
-
- Specified by:
handle in interface RequestHandler- Overrides:
handle in class RequestHandlerSupport
- Throws:
IOException
newGson
protected com.google.gson.Gson newGson(javax.servlet.http.HttpServletRequest request)
- Returns:
- customized
Gson instance.
accept
public boolean accept(javax.servlet.http.HttpServletRequest request)
-
- Specified by:
accept in interface RequestHandler- Overrides:
accept in class RequestHandlerSupport
isEnabled
public boolean isEnabled()
-
- Specified by:
isEnabled in interface RequestHandler- Overrides:
isEnabled in class RequestHandlerSupport
Copyright © 2008-2013. All Rights Reserved.