views:

449

answers:

3

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?

+2  A: 

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.

skaffman
This is what I ended up doing.... pretty similar to my original token replacement strategy. As you said, not complicated enough to warrant a special API.
jordan002
A: 

Hi jordan002,

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.

Kevin Stembridge
A: 

Try Juneloop.

lexicore