Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mvc-dev] Poll for new Jakarta MVC?

Hi all,

I think extending the MvcContext would be the easiest way to implement Gregors  proposals. 

> aka placing files in src/main/webapp

I guess the idea is to define a default path like we do for the view files, so we can provide convenience methods like `MvcContext#static(String resource)`, right Gregor? IMO this would be really helpful :)

Best regards,


Am 07.02.2021 um 16:58 schrieb Christian Kaltepoth <christian@xxxxxxxxxxxx>:

Hi Gregor,

Yes, I was thinking about something like the MvcContext , but maybe an extended version. The MvcContext only provides the baseURL and an url-builder for controllers, but not to the current request. Some of our ViewEngines (like freemarker) add the request to the binding as well, but as far as I know that’s not in the spec.

IMO we could make more information available via MvcContext. The basic idea of MvcContext was exactly what we are talking about here: Making information and other stuff available to the view engine at render time. Although you can also inject the MvcContext into a controller.

The main issue I was trying to raise was the handling of static assets (stylesheets, scripts, images, fonts): we don’t have anything in the spec about how to handle those. I usually just add a „static“ folder in src/main/webapp and add concatenate URLs to the base url, but I’m not sure if that’s portable to different containers.

That's how I would do it as well. I'm not sure if MVC needs any special support for static assets, because this works fine with plain old Servlet (aka placing files in src/main/webapp). But maybe I'm missing something here?

However, of course it would be very valuable to get more feedback from users.


mvc-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top