admin管理员组文章数量:1123886
My current situation is that I have a maven project which I'm deploying to Tomcat as a .war
file. Part of my project contents are actually third-party frontend pages (html/js/css) which result in two-way communication (I allow the user to navigate to these files using something like <a href="external/index.html">
, and as a result of user interaction these pages result in some kind of call back to my application via javascript).
The project structure resembles this:
- app/
|-- index.html
|-- js/
|-- css/
|-- external/
|---- index.html
|---- js/
|---- css/
What I would like to do is pull the external
contents out of my project/war file and instead link to them as some type of web resource. So far all of the solutions I've found seem to be focused on either externalizing the entire webapps directory, or setting single-page resources such as .pdf
files. Ideally these files wouldn't need to be hosted as a separate web application due to resource constraints and other concerns.
I've been trying to get something working that uses the answer posted in Simplest way to serve static data from outside the application server in a Java web application, but have been going in circles so wanted to verify this approach would work for what I was attempting.
EDIT:
Redirecting or forwarding won't work because this is data exists outside of my web application, but simply writing the html contents to the response will lose all the markup/scripts. Wondering if there might be something that could read this external
directory as a jsp, or if Spring has something for this, or if I'd need to flatten/minify the contents first?
本文标签: htmlIs it possible to externalize nested componentsStack Overflow
版权声明:本文标题:html - Is it possible to externalize nested components - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736606474a1945339.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论