[undertow-dev] Resource handler and Webjars

Bill O'Neil bill at dartalley.com
Thu Oct 19 18:25:01 EDT 2017


You can try wrapping the resource handlers in a path handler. If you can
provide sample paths and which goes to which resource that would be helpful.

On Oct 19, 2017 6:22 PM, "Ove Ranheim" <oranheim at gmail.com> wrote:

> How do I handle multiple ClassPathResourceManager(s)?
>
> undertowWebApp.getDeploymentInfo().setResourceManager(new ClassPathResourceManager(ClassLoaders.tccl(), MvcResourceConfig.STATIC_FOLDER));
> undertowWebApp.getDeploymentInfo().setResourceManager(new ClassPathResourceManager(ClassLoaders.tccl(), MvcResourceConfig.WEBJARS_RESOURCES));
>
> I have different contexts where I want to resolves static files.
>
> -Ove
>
> On 19 Oct 2017, at 16:35, Bill O'Neil <bill at dartalley.com> wrote:
>
> You should be able to use a ClassPathResourceManager, something along
> these lines. This should read files from the classpath which would include
> the jars. As long as you find the right file path it should work.
>
> ResourceManager resourceManager = new ClassPathResourceManager(
> CurrentClass.class.getClassLoader(),"someprefix");
> ResourceHandler handler = new ResourceHandler(resourceManager);
> handler.setCacheTime((int)TimeUnit.HOURS.toSeconds(4));
>
>
> On Wed, Oct 18, 2017 at 3:50 PM, Ove Ranheim <oranheim at gmail.com> wrote:
>
>> Hi,
>>
>> How do I register a resource handler for webjars.
>>
>> E.g. https://github.com/webjars/bootstrap-sass
>>
>> Regards,
>> Ove
>>
>>
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/undertow-dev
>>
>
>
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20171019/08bb3d1d/attachment-0001.html 


More information about the undertow-dev mailing list