我一直在尝试修改我的heroku应用程序的嵌入式tomcat配置。我已经使用下面的维基链接安装了heroku应用程序,它配置了一个简单的嵌入式tomcat。修改嵌入式tomcat的配置webapp
http://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat
的源代码是在这里:
public static void main(String[] args) throws Exception {
String webappDirLocation = "src/main/webapp/";
Tomcat tomcat = new Tomcat();
//The port that we should run on can be set into an environment variable
//Look for that variable and default to 8080 if it isn't there.
String webPort = System.getenv("PORT");
if(webPort == null || webPort.isEmpty()) {
webPort = "8080";
}
tomcat.setPort(Integer.valueOf(webPort));
tomcat.addWebapp("/", new File(webappDirLocation).getAbsolutePath());
System.out.println("configuring app with basedir: " + new File("./" + webappDirLocation).getAbsolutePath());
tomcat.start();
tomcat.getServer().await();
}
问题:
- 由于我使用的是嵌入式的tomcat,我该如何配置默认的会话超时我的web应用程序?由于某种原因,它似乎默认为30分钟?我想设置为像一个星期的东西。
- 如果我在eclipse中启动应用程序,我该如何设置
autodeploy = true
,以便每次修改java代码时都不必编译和重新启动我的应用程序? - 有没有办法设置我的web.xml和server.xml?
- 我该如何运行apache tomcat管理器?
因特网上的文档不是很清楚。你能帮忙吗?
在此先感谢.. 基兰
会话超时只是在web.xml中配置的,对吧?使用web.xml进行应用程序配置不应随嵌入式tomcat而改变。 – 2011-12-21 16:52:14