0

This might look weird but I would like to serve a "dynamic" JavaScript file. In fact the source code of the js will be stored in the database which will allow me to modify it without redeploying the app.

Right now I'm thinking about writing a servlet for doing this. Is this the right tool or is there a better way? I don't want to reinvent the wheel.

ForguesR
  • 3,558
  • 1
  • 17
  • 39
  • 1
    Seems like it would be the same thing as serving a dynamic PNG or other image file. Does searching for something like that bring up useful stuff? – K.Nicholas Jun 08 '16 at 00:37

1 Answers1

1

You have 2 options here

  1. You can create a servlet which query the database on demand

  2. You can host the js outside of the application. ie you can host in apache httpd server, or host in another path in the same tomcat server.

Tantowi Mustofa
  • 677
  • 4
  • 8