Eclipse RCP plugin + embedded Jetty + JSF

前端 未结 2 1785
走了就别回头了
走了就别回头了 2021-02-03 17:36

I made an RCP plugin with embedded Jetty as following:

1) In plugin.xml -> Dependencies, I have added the following:

org.eclipse.equinox.http.jetty
org.e         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-02-03 18:16

    Take a look at setting a context in jetty. You can define it before start your server.

    public class OneWebApp
    {
        public static void main(String[] args) throws Exception
        {
            String jetty_home = System.getProperty("jetty.home","..");
    
            Server server = new Server(8080);
    
            WebAppContext webapp = new WebAppContext();
            webapp.setContextPath("/");
            webapp.setWar(jetty_home+"/webapps/test.war");
            server.setHandler(webapp);
    
            server.start();
            server.join();
        }
    }
    

提交回复
热议问题