The JavaDoc for the ResourceServlet states that it can return a list of resources. But examples of this usage pattern seem to be sparse at best.
We have a web.xml with the following:
<servlet>
<servlet-name>Resource</servlet-name>
<servlet-class>org.springframework.web.servlet.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource</servlet-name>
<url-pattern>/combo</url-pattern>
</servlet-mapping>
When we make a request to url along the lines of: http://localhost:8080/app/combo?resource=js/file1.js;js/file2.js
We only seem to get file1 in the response.
What would a proper configuration be for this use case?
The ResourceServlet
has been deprecated in favour of using <mvc:resources />
However, it doesn't handle multiple resources. You'd have to make your own controller to do that.
As for the ResourceServlet
, the delimiters used in the code are ,; \t\n
- any of them should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With