-
Notifications
You must be signed in to change notification settings - Fork 35
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
Hot replace of static resources (html, png, etc.) #285
Comments
any update in this. I am facing the same issue. I try to play around server.xml but I am not having any luck |
Same issue. |
@kalatchev you can use extension of fsdeploy, the setting follow below in user setting on vscode "fsdeploy.nodes": [
{
"source": "${your java source WEB-INF path}",
"target": "${your java target WEB-INF path}",
"include": "**/*.*",
"exclude": "**/min/*.*"
}
] Then you can run tomcat project and modify static resources. After edited, you can refresh web page and you will found it's changed. |
I confirm that fsdeploy is a good solution. Just do it before using fsdeploy: determine Tomcat workspace in the setting of plugin then choose the target from this path |
I found a solution inspired by
{
"version": "2.0.0",
"tasks": [
// ... other tasks ...
{
"label": "compile",
"type": "shell",
"command": "mvn compile"
},
{
"label": "generate webapp",
"type": "shell",
"command": "mvn war:exploded"
},
{
"label": "Build Webapp",
"dependsOrder": "sequence",
"dependsOn": [
"compile", "generate webapp"
]
}
]
} This will create
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b"/>
<!-- ADD THIS -->
<Context docBase="/<absolute-path-to-project>/src/main/webapp" path="/<project-name>">
<Resources>
<PreResources base="/<absolute-path-to-project>/target/<project-name>/WEB-INF/classes" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/classes"/>
<PostResources base="/<absolute-path-to-project>/target/<project-name>/WEB-INF/lib" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF/lib"/>
</Resources>
</Context>
<!-- ADD THIS -->
</Host> Note that the absolute paths to Now the Tomcat Setup in ready. Above steps are needed only one time for a project. Right click on the If you use the hot reloading feature, I suggest running |
Extension works just fine. Excellent job! However, I have a question/issue with hot reload. When I change some java class, hot relaod does work. But when I change some static files, such as html, I am not able to tell the Tomcat to reload it. How can I do that?
The text was updated successfully, but these errors were encountered: