问题
I'm writing a servlet to return a JNLP file with several dynamically generated parameters to be passed to a web start program. Right now my code uses a stock template and token replacement, but I have to think there is a way to generate this file programmaticly within a servlet.
Are there any tools available for this?
回答1:
It's just an XML file, so I'd have thought there are various ways to do this, from your token-replace idea to a full template language like freemarker, or using programmatic DOM generation. It's doesn't seem complex enough to warrant a dedicated API of its own.
回答2:
Have you seen the JnlpDownloadServlet?
http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html
It can dynamically insert properties into the JNLP file that it serves up. It may not do exactly what you want it to do right now but its not too difficult to modify.
来源:https://stackoverflow.com/questions/986595/dynamicly-generate-a-jnlp-file-for-a-java-web-start-application