| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <title>Providing Web Console Plugins :: Apache Felix</title> |
| <link rel="canonical" href="https://felix.apache.org/documentation/subprojects/apache-felix-web-console/extending-the-apache-felix-web-console/providing-web-console-plugins.html"> |
| <meta name="generator" content="Antora 2.3.4"> |
| <link rel="stylesheet" href="../../../../_/css/site.css"> |
| <link rel="icon" href="../../../../_/img/favicon.png" type="image/x-icon"> |
| </head> |
| <body class="article"> |
| <header class="header"> |
| <nav class="navbar"> |
| <div class="navbar-brand"> |
| <a class="navbar-item" href="https://felix.apache.org/index.html"> |
| <span> |
| <img src="../../../../_/img/logo.png"> |
| </span> |
| </a> |
| <button class="navbar-burger" data-target="topbar-nav"> |
| <span></span> |
| <span></span> |
| <span></span> |
| </button> |
| </div> |
| <div id="topbar-nav" class="navbar-menu"> |
| <div class="navbar-end"> |
| <a class="navbar-item" href="https://felix.apache.org/index.html">Home</a> |
| <div class="navbar-item has-dropdown is-hoverable"> |
| <a class="navbar-link" href="#">Subprojects</a> |
| <div class="navbar-dropdown"> |
| <a class="navbar-item" href="../../apache-felix-dependency-manager.html">Dependency Manager</a> |
| <a class="navbar-item" href="../../apache-felix-event-admin.html">Event Admin</a> |
| <a class="navbar-item" href="../../apache-felix-file-install.html">File Install</a> |
| <a class="navbar-item" href="../../apache-felix-framework.html">Framework</a> |
| <a class="navbar-item" href="../../apache-felix-gogo.html">Gogo Shell</a> |
| <a class="navbar-item" href="../../apache-felix-healthchecks.html">Health Checks</a> |
| <a class="navbar-item" href="../../apache-felix-inventory.html">Inventory</a> |
| <a class="navbar-item" href="../../apache-felix-log.html">Log</a> |
| <a class="navbar-item" href="../../apache-felix-logback.html">Logback</a> |
| <a class="navbar-item" href="../../apache-felix-maven-bundle-plugin.html">Maven bundle plugin</a> |
| <a class="navbar-item" href="../../apache-felix-maven-scr-plugin.html">Maven SCR plugin</a> |
| <a class="navbar-item" href="../../apache-felix-metatype-service.html">Metatype Service</a> |
| <a class="navbar-item" href="../../apache-felix-preferences-service.html">Preferences Service</a> |
| <a class="navbar-item" href="../../apache-felix-remote-shell.html">Remote Shell</a> |
| <a class="navbar-item" href="../../apache-felix-script-console-plugin.html">Script console plugin</a> |
| <a class="navbar-item" href="../../apache-felix-shell.html">Lightweight shell</a> |
| <a class="navbar-item" href="../../apache-felix-shell-tui.html">Shell TUI</a> |
| <a class="navbar-item" href="../../apache-felix-web-console.html">Web Console</a> |
| </div> |
| </div> |
| <div class="navbar-item"> |
| <span class="control"> |
| <a class="button is-primary" href="../../../downloads.html">Downloads</a> |
| </span> |
| </div> |
| </div> |
| </div> |
| </nav> |
| </header> |
| <div class="body"> |
| <div class="nav-container" data-component="documentation" data-version="master"> |
| <aside class="nav"> |
| <div class="panels"> |
| <div class="nav-panel-menu is-active" data-panel="menu"> |
| <nav class="nav-menu"> |
| <h3 class="title"><a href="../../../index.html">Documentation</a></h3> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="0"> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../documentation.html">Documentation</a> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../downloads.html">Downloads</a> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../getting-started.html">Getting Started</a> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../news.html">News</a> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Community</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../community/project-info.html">Apache Felix Project Info</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../community/contributing.html">Contributing</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../community/projects-using-felix.html">Projects Using Felix</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Development</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/coding-standards.html">Coding Standards</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/dependencies-file-template.html">DEPENDENCIES file template</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/provisional-osgi-api-policy.html">Provisional OSGi API Policy</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/release-management-nexus.html">Release Management</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/site-how-to.html">Site How To</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../development/using-the-osgi-compliance-tests.html">Using the OSGi Compliance Tests</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../../faqs.html">FAQS</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../faqs/apache-felix-bundle-plugin-faq.html">Apache Felix Bundle Plugin Frequently Asked Questions</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../faqs/apache-felix-scr-plugin-faq.html">Apache Felix SCR Plugin Frequently Asked Questions</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../../subprojects.html">Subprojects</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../apache-felix-dependency-manager.html">Apache Felix Dependency Manager</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Guides</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/migrating-from-earlier-versions.html">Apache Felix Dependency Manager - Migrating from earlier versions</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/annotations.html">Dependency Manager - Annotations</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/background.html">Dependency Manager - Background</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/bundles-and-dependencies.html">Dependency Manager - Bundles and Dependencies</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/design-patterns.html">Dependency Manager - Design Patterns</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/development.html">Dependency Manager - Development</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/history.html">Dependency Manager - History</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/javadocs.html">Dependency Manager - JavaDocs</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/migrating-from-other-solutions.html">Dependency Manager - Migrating from other solutions.</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/performance-tuning.html">Dependency Manager - Performance Tuning</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/resources.html">Dependency Manager - Resource adapters</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/whatsnew.html">Dependency Manager - What’s new in version 4?</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/dm-lambda.html">Dependency Manager Lambda</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/guides/whatsnew-r15.html">What’s New in R15</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Reference</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-adapter.html">Dependency Manager - Adapter</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-aspect.html">Dependency Manager - Aspect</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-bundle-adapter.html">Dependency Manager - Bundle Adapter</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dependency-bundle.html">Dependency Manager - Bundle Dependency</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/components.html">Dependency Manager - Components</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dependency-configuration.html">Dependency Manager - Configuration Dependency</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dependencies.html">Dependency Manager - Dependencies</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/external-links.html">Dependency Manager - External Links</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-factory-configuration-adapter.html">Dependency Manager - Factory Configuration Adapter Service</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-resource-adapter.html">Dependency Manager - Resource Adapter</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dependency-resource.html">Dependency Manager - Resource Dependency</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dependency-service.html">Dependency Manager - Service Dependency</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/service-scopes.html">Dependency Manager - Service Scopes</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/component-singleton.html">Dependency Manager - Singleton Component</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/thread-model.html">Dependency Manager - Thread Model</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/reference/dm-annotations.html">Dependency Manager Annotations</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Tutorials</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/tutorials/working-with-annotations.html">Dependency Manager - Annotations</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/tutorials/getting-started.html">Dependency Manager - Getting Started</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/tutorials/leveraging-the-shell.html">Dependency Manager - Leveraging the shell</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="../../apache-felix-dependency-manager/tutorials/sample-code.html">Dependency Manager sample projects</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-event-admin.html">Apache Felix Event Admin</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-file-install.html">Apache Felix File Install</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../apache-felix-framework.html">Apache Felix Framework</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-framework/apache-felix-framework-bundle-cache.html">Apache Felix Framework Bundle Cache</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-framework/apache-felix-framework-configuration-properties.html">Apache Felix Framework Configuration Properties</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-framework/apache-felix-framework-faq.html">Apache Felix Framework Frequently Asked Questions</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-framework/apache-felix-framework-launching-and-embedding.html">Apache Felix Framework Launching and Embedding</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-framework/apache-felix-framework-usage-documentation.html">Apache Felix Framework Usage Documentation</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-framework-security.html">Apache Felix Framework Security</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../apache-felix-gogo.html">Apache Felix Gogo</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-gogo/rfc-147-overview.html">RFC 147 Overview</a> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-healthchecks.html">Apache Felix Health Checks</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-inventory.html">Apache Felix Inventory Printer</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-log.html">Apache Felix Log</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-logback.html">Apache Felix Logback</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-maven-bundle-plugin-bnd.html">Apache Felix Maven Bundle Plugin (BND)</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-metatype-service.html">Apache Felix Metatype Service</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-osgi-bundle-repository.html">Apache Felix OSGi Bundle Repository (OBR)</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-preferences-service.html">Apache Felix Preferences Service</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-remote-shell.html">Apache Felix Remote Shell</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-shell.html">Apache Felix Shell</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../apache-felix-shell-tui.html">Apache Felix Shell TUI</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../apache-felix-web-console.html">Apache Felix Web Console</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../extending-the-apache-felix-web-console.html">Extending the Apache Felix Web Console</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../web-console-restful-api.html">Web Console RESTful API</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../web-console-security-provider.html">Web Console Security Provider</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Extensions</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="branding-the-web-console.html">Branding the Web Console</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="providing-resources.html">Providing Resources</a> |
| </li> |
| <li class="nav-item is-current-page" data-depth="4"> |
| <a class="nav-link" href="providing-web-console-plugins.html">Providing Web Console Plugins</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="web-console-logging.html">Web Console Logging</a> |
| </li> |
| <li class="nav-item" data-depth="4"> |
| <a class="nav-link" href="web-console-output-templating.html">Web Console Output Templating</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">Maven SCR plugin</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/apache-felix-maven-scr-plugin-use.html">Apache Felix Maven SCR Plugin Use</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/apache-felix-scr-bndtools-use.html">Apache Felix SCR Annotations BndTools Use</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/apache-felix-scr-ant-task-use.html">Apache Felix SCR Ant Task Use</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/extending-scr-annotations.html">Extending SCR Annotations Excerpt: How add new Annotations extending the base Annotations</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/scr-annotations.html">SCR Annotations Excerpt: Using Java 5 Annotations to describe the component or service.</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../apache-felix-maven-scr-plugin/scr-javadoc-tags.html">SCR JavaDoc Tags Excerpt: Using JavaDoc Tags to describe the component or service.</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <button class="nav-item-toggle"></button> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations.html">Tutorials</a> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-application-demonstration.html">Apache Felix Application Demonstration</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial.html">Apache Felix OSGi Tutorial</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-faq.html">OSGi Frequently Asked Questions</a> |
| </li> |
| <li class="nav-item" data-depth="2"> |
| <button class="nav-item-toggle"></button> |
| <span class="nav-text">OSGI Tutorial</span> |
| <ul class="nav-list"> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-1.html">Apache Felix Tutorial Example 1 - Service Event Listener Bundle</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-2.html">Apache Felix Tutorial Example 2</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-2b.html">Apache Felix Tutorial Example 2b</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-3.html">Apache Felix Tutorial Example 3</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-4.html">Apache Felix Tutorial Example 4</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-5.html">Apache Felix Tutorial Example 5</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-6.html">Example 6 - Spell Checker Service Bundle</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-7.html">Example 7 - Spell Checker Client Bundle</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-8.html">Example 8 - Spell Checker Service using Service Binder</a> |
| </li> |
| <li class="nav-item" data-depth="3"> |
| <a class="nav-link" href="../../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html">Example 9 - Spell Checker Service using Declarative Services</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../license.html">Apache License 2.0</a> |
| </li> |
| <li class="nav-item" data-depth="1"> |
| <a class="nav-link" href="../../../site-map.html">Site map</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </nav> |
| </div> |
| <div class="nav-panel-explore" data-panel="explore"> |
| <div class="context"> |
| <span class="title">Documentation</span> |
| <span class="version">master</span> |
| </div> |
| <ul class="components"> |
| <li class="component is-current"> |
| <span class="title">Documentation</span> |
| <ul class="versions"> |
| <li class="version is-current is-latest"> |
| <a href="../../../index.html">master</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </aside> |
| </div> |
| <main class="article"> |
| <div class="toolbar" role="navigation"> |
| <button class="nav-toggle"></button> |
| <a href="../../../index.html" class="home-link"></a> |
| <nav class="breadcrumbs" aria-label="breadcrumbs"> |
| <ul> |
| <li><a href="../../../index.html">Documentation</a></li> |
| <li><a href="../../../subprojects.html">Subprojects</a></li> |
| <li><a href="../../apache-felix-web-console.html">Apache Felix Web Console</a></li> |
| <li>Extensions</li> |
| <li><a href="providing-web-console-plugins.html">Providing Web Console Plugins</a></li> |
| </ul> |
| </nav> |
| <div class="edit-this-page"><a href="https://github.com/apache/felix-antora-site/edit/main/modules/ROOT/pages/subprojects/apache-felix-web-console/extending-the-apache-felix-web-console/providing-web-console-plugins.adoc">Edit this Page</a></div> |
| </div> |
| <div class="content"> |
| <article class="doc"> |
| <h1 class="page">Providing Web Console Plugins</h1> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The Web Console can be extended by registering an OSGi service for the interface <code>javax.servlet.Servlet</code> with the service property <code>felix.webconsole.label</code> set to the label (last segment in the URL) of the page. |
| The respective service is called a Web Console Plugin or a plugin for short.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The most basic plugin is a plain old Servlet whose <code>service(ServletRequest, ServletResponse)</code> method is called by the Apache Felix Web Console. |
| Before calling the servlet the web console sets two request attributes helping the plugin rendering the response:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>`felix.webconsole.appRoot`</em> — This request attribute of type <code>String</code> provides the absolute path of the Web Console root. |
| This path consists of the servlet context path (from <code>ServletRequest.getContextPath()</code>) and the Web Console servlet path (from <code>HttpServletRequest.getServletPath()</code>, <code>/system/console</code> by default). |
| This attribute can be used to provide absolute links to resources (images, CSS, scripts, etc.) or other plugins. |
| This request attribute is available to client side JavaScript as the global <em>`appRoot`</em> variable.</p> |
| </li> |
| <li> |
| <p><em>`felix.webconsole.pluginRoot`</em> — This request attribute of type <code>String</code> provides the absolute path of the current plugin. |
| This path consists of the servlet context path (from <code>ServletRequest.getContextPath()</code>), the Web Console servlet path (from <code>HttpServletRequest.getServletPath()</code>, <code>/system/console</code> by default) and the plugin label. |
| This attribute can be used to provide absolute links to the plugin itself. |
| This request attribute is available to client side JavaScript as the global <em>`pluginRoot`</em> variable.</p> |
| </li> |
| <li> |
| <p><em>`felix.webconsole.labelMap`</em> — This request attribute of type <code>Map</code> provides a mapping of labels to page titles of registered console plugins. |
| This map may be used to render a navigation of the console plugins such as the <code>AbstractWebConsolePlugin.renderTopNavigation</code> method does. |
| The keys and values of the map are of type <code>String</code>.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>To help rendering the response the Apache Felix Web Console bundle provides two options: One option is to extend the <code>AbstractWebConsolePlugin</code> overwriting the <code>renderContent</code> method. |
| The other option is to register the servlet with another service registration property to indicate the desire to wrap the response.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_extending_the_abstractwebconsoleplugin"><a class="anchor" href="#_extending_the_abstractwebconsoleplugin"></a>Extending The AbstractWebConsolePlugin</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>To leverage the rendering of the common header and footer around the plugin’s data area, the plugin can extend the abstract <code>org.apache.felix.webconsole.AbstractWebConsolePlugin</code> class implementing the following methods:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>`renderContext(HttpServletRequest, HttpServletResponse)`</em> — This method is called to render the actual plugin data area.</p> |
| </li> |
| <li> |
| <p><em>`getLabel()<code></em> — Returns the last path segment of the plugin page. |
| This should return the value to which the `felix.webconsole.label</code> service registration propery is set.</p> |
| </li> |
| <li> |
| <p><em>`getTitle()`</em> — Returns a human readable title to be displayed at the top of the plugin page.</p> |
| </li> |
| <li> |
| <p><em>`getCssReferences()`</em> — See the section <em>Providing CSS Files</em> below.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>To fully leverage the <code>AbstractWebConsolePlugin</code> it must be initialiazed before registering the extension as a service. |
| Likewise after unregistering the service, the plugin should be destroyed. |
| To this avail the following methods are provided in the <code>AbstractWebConsolePlugin</code>:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>`activateBundle(BundleContext)<code></em> — Initializes the plugin with the `BundleContext</code> and prepares some data to be rendered in the header and footer areas.</p> |
| </li> |
| <li> |
| <p><em>`deactivate()`</em> — Destroys the plugin.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>In addition to these OSGi-oriented setup methods the Web Console itself will call the <code>Servlet.init(ServletConfig)</code> method before putting the plugin into service and the <code>Servlet.destroy()</code> method when the plugin is removed.</p> |
| </div> |
| <h4 id="_providing_css_files" class="discrete">Providing CSS Files</h4> |
| <div class="paragraph"> |
| <p>Part of rendering the header, the <code>AbstractWebConsolePlugin</code> also emits links to CSS files to include for displaying the page. |
| Since such CSS links may only be present in the header section of the generated HTML the <code>getCssReferences()</code> method is provided. |
| This method is called to create links for additional CSS files. |
| The default implementation of this method returns <code>null</code> meaning no additional CSS links to be rendered. |
| Extensions of the <code>AbstractWebConsolePlugin</code> may overwrite this method to provide a list of CSS links.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The CSS links provided by the <code>getCssReferences()</code> method may be absolute or relative paths, though relative paths are recommended. |
| Relative paths are turned into absolute path by prepending them with the value of the <code>felix.webconsole.appRoot</code> request attribute.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_transparent_response_wrapping"><a class="anchor" href="#_transparent_response_wrapping"></a>Transparent Response Wrapping</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>While being very simple and straight forward, extending the <code>AbstractWebConsolePlugin</code> actually creates a binding from the plugin provider bundle to the Web Console bundle, which may be undesired. |
| To support the use case of wanting the benefits of the <code>AbstractWebConsolePlugin</code> but wiring independency of the Web Console, a plugin servlet may be registered with a second service registration property (besides the required <code>felix.webconsole.label</code>):</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>`felix.webconsole.title`</em> — If registered servlet does not extend the <code>AbstractWebConsolePlugin</code> but provides this property (of type <code>String</code>) the servlet is wrapped in an adapter to the <code>AbstractWebConsolePlugin</code> which calls <code>Servlet.service(ServletRequest, ServletResponse)</code> method on behalf of the <code>renderContent</code> implementation.</p> |
| </li> |
| <li> |
| <p><em>`felix.webconsole.css`</em> — Defines a single string, an array of strings or a Collection of strings to be used as the values provided by the <code>getCssReferences()</code> method. |
| This property is optional. |
| If this property is missing or if the value does not have the correct type, the <code>getCssReferences()</code> just returns <code>null</code> assuming there are no additional CSS resources to reference.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>The wrapper around the plugin itself extends the <code>AbstractWebConsolePlugin</code> as follows:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>`renderContext(HttpServletRequest, HttpServletResponse)<code></em> — Calls the `service(HttpServletRequest, HttpServletResponse)</code> method of the plugin to render the actual contents of the plugin.</p> |
| </li> |
| <li> |
| <p><em>`getLabel()<code></em> — Returns the value of the `felix.webconsole.label</code> service registration property of the plugin.</p> |
| </li> |
| <li> |
| <p><em>`getTitle()<code></em> — Returns the value of the `felix.webconsole.title</code> service registration property of the plugin.</p> |
| </li> |
| <li> |
| <p><em>`getCssReferences()<code></em> — Returns the values of the `felix.webconsole.css</code> service registration property of the plugin.</p> |
| </li> |
| <li> |
| <p><em>`service(ServletRequest, ServletResponse)<code></em> — If the request method is `GET</code> the <code>service(ServletRequest, ServletResponse)</code> method of the <code>AbstractWebConsolePlugin</code> is called which ultimately calls the <code>service</code> method. |
| For all other requests, the <code>service(ServletRequest, ServletResponse)</code> method of the plugin is called directly to have the plugin handle any non-<code>GET</code> requests directly.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Please note, that sometimes it is not desirable to have the <code>AbstractWebConsolePlugin</code> render the header and footer of the response. |
| For this reason, the <code>AbstractWebConsolePlugin</code> only renders the header and footer if the request to such a wrapped plugin either has no extension or if the extension is <code>.html</code>. |
| For any other extension, e.g. |
| <code>.txt</code> or <code>.json</code>, the header and footer is not rendered and the <code>service</code> method of the plugin is directly called.</p> |
| </div> |
| <div class="paragraph"> |
| <p>It is suggested that plugins extend from the <code>javax.servlet.http.HttpServlet</code> class and implement the appropriate <code>doXxx(HttpServletRequest, HttpServletResponse)</code> methods such as <code>doGet</code> and <code>doPost</code>. |
| In addition, unless non-GET requests are handled through AJAX calls, it is suggested that non-GET requests return a redirect after processing the request.</p> |
| </div> |
| </div> |
| </div> |
| </article> |
| <aside class="toc sidebar" data-title="Contents" data-levels="2"> |
| <div class="toc-menu"></div> |
| </aside> |
| </div> |
| </main> |
| </div> |
| <footer class="footer"> |
| <p>Content licensed under AL2. UI licensed under MPL-2.0 with extensions licensed under AL2</p> |
| </footer> |
| <script src="../../../../_/js/site.js"></script> |
| <script async src="../../../../_/js/vendor/highlight.js"></script> |
| </body> |
| </html> |