The fastest way to deploy and run Java war files?
•
Java
Is there a simple programming way to quickly "deploy" and run standard Java war files for local testing without installing and configuring external packages such as Tomcat or jetty? Ideally, jetty's embeddable functionality, but specifically for war files
Java 6 provides a convenient endpoint class, which can easily and quickly deploy and test web services. Is there anything similar to war files? For example:
AppServer as = new javax.iwish.AppServer("localhost",8080); as.deploy("/",new File("path/to/my.war"); as.start();
Solution
I asked too early. It looks like jetty does exactly what I need:
Server server = new Server(8080); server.setHandler(new WebAppContext("foo.war","/")); server.start();
Very close to my dream API = D
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码