if (pluginName.startsWith("/"))
{
pluginName = pluginName.substring(1);
pluginName = pluginName.split("/")[0];
}
JSONRequest jsonReq = (JSONRequest) PluginManager.getNamedPlugin(JSONRequest.class,
pluginName);
if (jsonReq == null)
{
log.error(LogManager.getHeader(context, "jsonrequest",
"No plugin found for manage the path " + pluginName));
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
jsonReq.setSubPath(pluginName);
try
{
response.setContentType("application/json; charset=UTF-8");
jsonReq.doJSONRequest(context, request, response);
}
catch (Exception e)
{
// no need to log, logging is already done by the
// InternalErrorServlet