Solution 1:

Your problem sums up to rewriting the absolute request URIs, which come from the application server. This can be done twofold:

  1. Apache2 can rewrite all URIs in the proxied content. It is rather difficult to catch all locations where an URI can occur.
  2. Tomcat7 can use the same absolute request URIs as the Apache server.

I would suggest the second way, since it is the easiest one. You should:

  1. Deploy the web application on /my_demo instead of /webui. This may be as simple as renaming webapps/webui to webapps/my_demo in CATALINA_BASE.
  2. Configure Apache to proxy /my_demo/ to https://example.com:4444/my_demo/:

    ProxyPass "/my_demo/" "https://example.com:4444/my_demo/"
    ProxyPassReverse "/my_demo/" "https://example.com:4444/my_demo/"
    

PS: Using HTTPS for Tomcat is IMHO overkill, just configure an HTTP connector with the secure and scheme attributes changed, so that Tomcat knows it is being proxied through HTTPS:

<Connector port="4444"
           scheme="https" secure="true"
           proxyName="example.com"
           proxyPort="443"/>

and change https to http in the ProxyPass directives.