-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Asset Support #63
Comments
Let's start some discussion about how this could look like in MVC. Basically the goal would be to provide a way to reference static assets without using any Servlet specific features (because MVC does NOT require Servlet at the moment). This could for example look like this: <img src="${mvc.asset('files/logo.png')}" alt="logo"/> The MVC implementation would generate some URL and also make sure to serve the corresponding asset from this URL. The first question is where the MVC implementation looks for such assets. Maybe simply in Another question is how the MVC implementation should handle the content type of such assets. Should we require the implementation to "guess" it from the corresponding file extension? This is just a quick summary of what I have in mind regarding this feature. But maybe somebody has a completely different understanding or has some other idea? Feedback welcome! :-) |
I like Christians proposals, so +1 for it in general. Maybe we can additionally make the API more meaningful and provide some "standard" directories so users have a template, like
Those preconfigured directories could be configurable by some property, so we'd have a default template for all users wanting an easy start and a possibility to adapt it to personal needs for advanced topics. |
I wouldn't see this as a requirement for the first version of this feature. As you already mentioned, this would also require additional configuration parameters to be able to customize these directories. And I personally don't think that having something like The most important question for me is how to deal with content types. I just tried to figure out how Servlet handles this, but the spec doesn't seem to mention this at all. Or maybe I just don't find the relevant section in the spec document. Anyone has more insights? |
After I've built and used a mechanism inspired by this issue in an application, I can say that the content type is properly handled by the underlaying container. So I think this isn't a problem. What I recognized is that the placement of files is more relevant than thought, because there are differences in processing between the servers. So my current approach is to use |
Isn't |
Thanks for the information. I'll try to find so time to test your approach. Maybe this is the solution for my problem :) Anyway, it's weird that only Glassfish seems to have a problem here 🤔 |
I guess that's because app servers handle the class loader complexity quite differently!? |
Maybe 🤷🏻 But let's try it with your approach. That seems promising. |
No description provided.
The text was updated successfully, but these errors were encountered: