servlet get activation/deactivation
Hi,
I have a replicator that call a servlet. I need to recovery from the request the type of the operation: activate or deactivate.
public void handleRequest(SlingHttpServletRequest req) throws IOException { log.info("handleRequest"); Enumeration<String> parameterNames = req.getParameterNames(); while (parameterNames.hasMoreElements()) { String paramName = parameterNames.nextElement(); log.info("paramName "+paramName); String[] paramValues = req.getParameterValues(paramName); for (int i = 0; i < paramValues.length; i++) { String paramValue = paramValues[i]; log.info("paramValue "+paramValue); } } }I have no parameters in output from this code and if i parse all the request:
private String getRequestType(SlingHttpServletRequest request) { try{ BufferedReader reader = request.getReader(); String line; while ((line = reader.readLine()) != null) { log.info("getRequestType "+line); } }catch(Exception e){ log.info(e.getMessage()); } return null; }I have a print like this:
DurboSer 2.1 ContentType durboser/unstructured Encoding startPath /content/gimb_it/fullloading orderSiblings 2it,system,en,fullloading,fullloadingsinglerequest, orderChildren parentNodeTypes cq:Page,sling:OrderedFolder fullloading! jcr http://www.jcp.org/jcr/1.0 jcr:primaryType cq:Page jcr:createdBy admin jcr:created 2015-10-07T12:02:25.871+02:00 jcr:content jcr:primaryType cq:PageContent jcr:uuid $0f1eb7b5-0473-4fa3-aa8e-69b3dd105014 jcr:mixinTypes mix:versionable,! sling %http://sling.apache.org/jcr/sling/1.0 sling:resourceType gimb/components/page/fullLoading jcr:title fullloading jcr:created 2015-10-07T12:02:25.873+02:00! cq http://www.day.com/jcr/cq/1.0 cq:template /apps/gimb/templates/fullLoading cq:lastModifiedBy admin jcr:createdBy admin cq:lastModified 2015-10-07T12:02:25.874+02:00//
I can't find a parameter to know the type of the action.
The code above is from an activation, the deactivation has an empty request body
How can i know the type of the request?
Thanks