Java + Web interface [closed]
I'm writing a small application and I want to visualize results so I can see them in a web browser. For example, I want to display a plot of my data points.
Sure, I can write a http listener, that will serve an programatically built html. Or I can use java web application stack, but this seems a bit heavy weight for this simple task.
What do you recommend to do?
I would recommend using an embedded Jetty Server in your application. It's small and lightweight, and doesn't require to write the http-listener.
Embedding Jetty
The embedded jetty makes it easy to write a simple servlet and add some custom libraries.
A simple Jetty server with a JSP page maybe? If you need to programmatically draw a plot from data points then you'll probably need extra libraries for that.
What about creating a HTML file containing the plot of your data points as an image? You would only need to install a small and lightwight http server?
If you want to create the plot on demand (when you display the website) and give it some parameters via URL I think you will need a Java Application Server (e.g. Glassfish, Tomcat, etc) and create a web-app that reads those parameters, computes your chart/image/whatever and then displays it in a jsp page
精彩评论