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,
Tobias
Am 07.02.2021 um 16:58 schrieb Christian Kaltepoth <christian@xxxxxxxxxxxx>:
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.
Christian
--
_______________________________________________
mvc-dev mailing list
mvc-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/mvc-dev
|