@Override
	protected void renderContent(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		log.trace("renderContent");

		Map<String, String> pageProps = new HashMap<String, String>();
		pageProps.put("message", "");
		pageProps.put("searchAllChecked", "");
		pageProps.put("resourceType", "");

		ComponentBindingsProviderFactoryImpl factoryImpl = (ComponentBindingsProviderFactoryImpl) factory;

		if ("true".equals(req.getParameter("reloadCache"))) {
			factoryImpl.reloadCache();
			pageProps.put("message", "Cache Reloaded");
		}
		List<ServiceReference> bindingProviders = new ArrayList<ServiceReference>();
		String resourceType = req.getParameter("resourceType");
		if (!StringUtils.isEmpty(resourceType)) {
			log.debug("Searching for resource type: {}", resourceType);
			pageProps.put("resourceType", resourceType);
			bindingProviders = factoryImpl.getReferences(req
					.getParameter("resourceType"));
		} else if ("true".equals(req.getParameter("searchAll"))) {
			pageProps.put("searchAllChecked", "checked");
			log.debug("Searching for all binding providers");
			for (String rt : factoryImpl.getLoadedResourceTypes()) {
				log.debug("Searching for resource type: {}", rt);
				for (ServiceReference reference : factoryImpl.getReferences(rt)) {
					if (!bindingProviders.contains(reference)) {
						bindingProviders.add(reference);
					}
				}
			}
		}

		renderBlock(res, "header.html", pageProps);
		renderBlock(res, "search.html", pageProps);

		for (int i = 0; i < bindingProviders.size(); i++) {
			Map<String, String> properties = loadProperties(bindingProviders
					.get(i));
			properties.put("state", (i + 1) % 2 == 0 ? "even" : "odd");
			renderBlock(res, "result.html", properties);
		}
		res.getWriter().write("</tbody></table>");

		res.getWriter()
				.write("<table><tr><th class=\"content ui-state-default\">Recent Exceptions</th></tr>");

		for (final Object obj : componentBindingsValuesProvider
				.getRecentExceptions()) {
			renderBlock(res, "exception.html", new HashMap<String, String>() {
				private static final long serialVersionUID = 1L;
				{
					put("ex", obj.toString());
				}
			});
		}
		res.getWriter().write("</table>");
	}
@ Override protected void renderContent ( HttpServletRequest req , HttpServletResponse res ) throws ServletException , IOException { log . trace ( "renderContent" ) ; Map < String , String > pageProps = new HashMap < String , String > ( ) ; pageProps . put ( "message" , "" ) ; pageProps . put ( "searchAllChecked" , "" ) ; pageProps . put ( "resourceType" , "" ) ; ComponentBindingsProviderFactoryImpl factoryImpl = ( ComponentBindingsProviderFactoryImpl ) factory ; if ( "true" . equals ( req . getParameter ( "reloadCache" ) ) ) { factoryImpl . reloadCache ( ) ; pageProps . put ( "message" , "Cache Reloaded" ) ; } List < ServiceReference > bindingProviders = new ArrayList < ServiceReference > ( ) ; String resourceType = req . getParameter ( "resourceType" ) ; if ( ! StringUtils . isEmpty ( resourceType ) ) { log . debug ( "Searching for resource type: {}" , resourceType ) ; pageProps . put ( "resourceType" , resourceType ) ; bindingProviders = factoryImpl . getReferences ( req . getParameter ( "resourceType" ) ) ; } else if ( "true" . equals ( req . getParameter ( "searchAll" ) ) ) { pageProps . put ( "searchAllChecked" , "checked" ) ; log . debug ( "Searching for all binding providers" ) ; for ( String rt : factoryImpl . getLoadedResourceTypes ( ) ) { log . debug ( "Searching for resource type: {}" , rt ) ; for ( ServiceReference reference : factoryImpl . getReferences ( rt ) ) { if ( ! bindingProviders . contains ( reference ) ) { bindingProviders . add ( reference ) ; } } } } renderBlock ( res , "header.html" , pageProps ) ; renderBlock ( res , "search.html" , pageProps ) ; for ( int i = 0 ; i < bindingProviders . size ( ) ; i ++ ) { Map < String , String > properties = loadProperties ( bindingProviders . get ( i ) ) ; properties . put ( "state" , ( i + 1 ) % 2 == 0 ? "even" : "odd" ) ; renderBlock ( res , "result.html" , properties ) ; } res . getWriter ( ) . write ( "</tbody></table>" ) ; res . getWriter ( ) . write ( "<table><tr><th class=\"content ui-state-default\">Recent Exceptions</th></tr>" ) ; for ( final Object obj : componentBindingsValuesProvider . getRecentExceptions ( ) ) { renderBlock ( res , "exception.html" , new HashMap < String , String > ( ) { private static final long serialVersionUID = 1L ; { put ( "ex" , obj . toString ( ) ) ; } } ) ; } res . getWriter ( ) . write ( "</table>" ) ; }
/*
(non-Javadoc)

@see
org.apache.felix.webconsole.AbstractWebConsolePlugin#renderContent(javax
.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)