[undertow-dev] Configure Undertow to use ViewResolver similar to Spring MVC and serve static content

aditya sanas aditya.sanas at gmail.com
Thu May 10 01:12:20 EDT 2018


Hello Stuart,

I tried in many ways for this, but it seems my dispatcher servlet settings
is being considered always and not allowing to serve static content.
Anyways we decided to move to Springboot + undertow.

Thanks,
Aditya Sanas

On Tue, May 8, 2018 at 3:08 AM, Stuart Douglas <sdouglas at redhat.com> wrote:

> It sounds like you need to configure a resource manager to serve static
> content.
>
> You need to call DeploymentInfo.setResourceManager() with a resource
> manager than can resolve the static content you want to serve, if it is
> just plain files on the file system you should just use PathResourceManager.
>
> I am not sure about the view resolver, it sounds like you might be missing
> a servlet or filter than spring expects to be configured.
>
> Stuart
>
> On Fri, May 4, 2018 at 7:30 PM, aditya sanas <aditya.sanas at gmail.com>
> wrote:
>
>> Hello Undertow Dev Team,
>>
>>
>>
>> Currently I’m doing a sample project where I’m trying to configure
>> Undertow server to use Spring MVC model.
>>
>> I’m able to register dispatcher servlet, context listeners, and able to
>> configure application so that I can use spring controllers instead of
>> servlets to process requests from browsers. So I can return JSON/XML or
>> Plain text if I use RestController.
>>
>>
>>
>> The thing where I’m currently stuck is I’m not able to serve a static
>> content and cannot configure a Spring’s view resolver to return a view
>> instead of plain text.
>>
>>
>>
>> PS - I’m using  Undertow as embedded server into my application and
>> producing a standalone executable jar as a build output.
>>
>>
>>
>> Thanks,
>>
>> Aditya Sanas
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180510/228cbbe4/attachment.html 


More information about the undertow-dev mailing list