Bug 59027 - Tomcat Virtual Host Manager application doesn't persist newly created virtual hosts
Summary: Tomcat Virtual Host Manager application doesn't persist newly created virtual...
Status: RESOLVED DUPLICATE of bug 48674
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Manager (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-18 15:07 UTC by Coty Sutherland
Modified: 2016-02-18 15:14 UTC (History)
2 users (show)



Attachments
Rough patch proposal (9.55 KB, patch)
2016-02-18 15:07 UTC, Coty Sutherland
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Coty Sutherland 2016-02-18 15:07:04 UTC
Created attachment 33569 [details]
Rough patch proposal

+++ This bug was initially created as a clone of Bug #48674 +++

If one create virtual host using /host-manager application all work as
expected. Start/Stop/Remove actions.
But newly created host is not persistently added to the Tomcat configuration.
After restart of Tomcat there is only localhost host listed.
Comment 1 Mark Thomas 2016-02-18 15:12:19 UTC

*** This bug has been marked as a duplicate of bug 48674 ***
Comment 2 Coty Sutherland 2016-02-18 15:14:51 UTC
This enhancement was brought to my attention and seemed like a relatively easy thing to add, so I gave it a shot. Instead of using the patch from the original bug I re-implemented the request using StoreConfig. This makes the changes a lot smaller and prevented functional duplication of code that already existed in StoreConfig. Note that this patch isn't 100% complete; I'm looking for some feedback on how I can resolve a couple of things before I would consider it complete.

My original thought was to add a button next to each host that would be available to persist the host's configuration, however I think the StoreConfig interface Impl needs some changes to make that happen, so I'm just using storeConfig to save the complete configuration. I left the button on the host row because I couldn't figure out where else to put it (feedback please). Maybe it should be a link at the top? I also just noticed when I was doing some testing that there is no way to remove a host and persist that, so that furthers the idea that the button should be somewhere else on the page.

If StoreConfig isn't enabled when you click the persist button it will provide a failure message that suggests enabling it by catching the InstanceNotFound exception.