xautlx / s2jh

A Java/J2EE development framework for enterprise system based on Struts/Spring/JPA/Hibernate and jquery/bootstrap
GNU Lesser General Public License v3.0
321 stars 242 forks source link

如何调试运行呢?有没有快捷的方式? #32

Closed xiaolongyuan closed 10 years ago

xiaolongyuan commented 10 years ago

例如这种的 https://github.com/ketayao/keta-custom/blob/master/keta-custom-resources/src/test/java/com/ketayao/ketacustom/test/QuickStartServer.java

 public static void main(String[] args) throws Exception {
            // 设定Spring的profile
            System.setProperty("spring.profiles.active", "production");

            JettyServer jettyServer = new JettyServer(PORT, CONTEXT);
            jettyServer.setTldJarNames(TLD_JAR_NAMES);

            // 启动Jetty
            try {
                    jettyServer.start();

                    System.out.println("启动成功,请使用该路径访问系统:" + BASE_URL);
                    System.out.println("在控制台输入'r'重新加载应用,输入'q'退出jetty程序!");

                    while (true) {
                            char c = (char) System.in.read();
                            if (c == 'r') {
                                    jettyServer.reloadContext();
                            } else if (c == 'q') {
                                    break;
                            }
                    }
            } catch (Exception e) {
                    e.printStackTrace();
            } finally {
                    System.exit(-1);
            }
    }
xautlx commented 10 years ago

如果是演示运行可参考:https://github.com/xautlx/s2jh/wiki/ExecutableWAR 至于开发调试还没有这样的支持,如果乐意欢迎添砖加瓦编写对应实现提交Pull Request

xautlx commented 10 years ago

框架暂时不考虑单独实现这个,这方面有兴趣可以了解一下jrebel