You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2022. It is now read-only.
I have jetty running inside karaf and I am able to register a servlet at "/products" but now I want to have another servlet registered at a different context say : /animals ? How to do that ?
Even if create a separate connector on jetty , I'd still have to override the "root" property of the same jaxrs connector that would mean overwriting the previous one which would mean now /animals would work and /products won't.
Any way around this problem ?
privatevoidupdateConfiguration() throwsIOException
{
LOGGER.info("Entering in method updateConfiguration,Configuration web services will be published on context path: {}", CONTEXT_PATH);
configureJerseyConfiguration();
configureJaxRsPublisher();
}
privatevoidconfigureJerseyConfiguration()
{
ConfigurationcomponentConfiguration;
try
{
componentConfiguration = getServiceConfiguration(JERSEY_SERVER_PID);
Dictionary<String, Object> properties = componentConfiguration.getProperties();
if (properties == null)
{
properties = newHashtable<String, Object>();
}
properties.put(JERSEY_CONFIG_SERVER_WADL_DISABLE_WADL, DISABLE_WADL_PROPERTY);
componentConfiguration.update(properties);
LOGGER.debug("Inside configureJerseyConfiguration,Configured the Jeresy wadl: {}", DISABLE_WADL_PROPERTY);
}
catch (IOException | ConfigurationExceptione)
{
LOGGER.error("Inside configureJerseyConfiguration,There was a problem in upgrading the JAX RS connector configuration,Exception occured is: {}", e.getMessage());
}
}
/** * @param componentContext */privatevoidconfigureJaxRsPublisher()
{
LOGGER.debug("Entering in method configureJaxRsPublisher,Configuring the JAX RS connector.");
ConfigurationcomponentConfiguration;
try
{
componentConfiguration = getServiceConfiguration(JAXRS_CONNECTOR_PID);
componentConfiguration.getBundleLocation();
Dictionary<String, Object> properties = componentConfiguration.getProperties();
if (properties == null)
{
properties = newHashtable<String, Object>();
}
properties.put("root", "/products"); // <<<<<<<<<<<<<<< Look herecomponentConfiguration.update(properties);
LOGGER.debug("Inside configureJaxRsPublisher, Configured the JAX RS connector with contextPath: {}", CONTEXT_PATH);
}
catch (IOException | ConfigurationExceptione)
{
LOGGER.error("Inside configureJaxRsPublisher,There was a problem in upgrading the JAX RS connector configuration, Exception occured is: {}", e.getMessage());
}
}
The text was updated successfully, but these errors were encountered:
Problem:
I have jetty running inside karaf and I am able to register a servlet at "/products" but now I want to have another servlet registered at a different context say : /animals ? How to do that ?
Even if create a separate connector on jetty , I'd still have to override the "root" property of the same jaxrs connector that would mean overwriting the previous one which would mean now /animals would work and /products won't.
Any way around this problem ?
The text was updated successfully, but these errors were encountered: