* Introduce hopdir servlet parameter to be able to set the helma directory.
This commit is contained in:
parent
585725d9c6
commit
2734f70d6a
1 changed files with 16 additions and 3 deletions
|
@ -19,6 +19,9 @@ package helma.servlet;
|
|||
import helma.framework.repository.Repository;
|
||||
import helma.framework.core.Application;
|
||||
import helma.framework.repository.FileRepository;
|
||||
import helma.main.ServerConfig;
|
||||
import helma.main.Server;
|
||||
|
||||
import java.io.*;
|
||||
import javax.servlet.*;
|
||||
import java.util.*;
|
||||
|
@ -40,7 +43,7 @@ public final class StandaloneServletClient extends AbstractServletClient {
|
|||
private String appName;
|
||||
private String appDir;
|
||||
private String dbDir;
|
||||
// private String hopDir;
|
||||
private String hopDir;
|
||||
private Repository[] repositories;
|
||||
|
||||
/**
|
||||
|
@ -53,7 +56,12 @@ public final class StandaloneServletClient extends AbstractServletClient {
|
|||
public void init(ServletConfig init) throws ServletException {
|
||||
super.init(init);
|
||||
|
||||
// hopDir = init.getInitParameter("hopdir");
|
||||
hopDir = init.getInitParameter("hopdir");
|
||||
|
||||
if (hopDir == null) {
|
||||
// assume helmaDir to be current directory
|
||||
hopDir = ".";
|
||||
}
|
||||
|
||||
appName = init.getInitParameter("application");
|
||||
|
||||
|
@ -146,8 +154,13 @@ public final class StandaloneServletClient extends AbstractServletClient {
|
|||
try {
|
||||
File dbHome = new File(dbDir);
|
||||
File appHome = new File(appDir);
|
||||
File hopHome = new File(hopDir);
|
||||
|
||||
app = new Application(appName, null, repositories, appHome, dbHome);
|
||||
ServerConfig config = new ServerConfig();
|
||||
config.setHomeDir(hopHome);
|
||||
Server server = new Server(config);
|
||||
|
||||
app = new Application(appName, server, repositories, appHome, dbHome);
|
||||
app.init();
|
||||
app.start();
|
||||
} catch (Exception x) {
|
||||
|
|
Loading…
Add table
Reference in a new issue