| commit 731: | 4f5efd19e557 |
| parent 730: | 6e910251dad5 |
| branch: | default |
Remove support for using the webapp without a configuration file
20 months ago
Changed (Δ756 bytes):
raw changeset »
conf/web.xml (0 lines added, 12 lines removed)
src/org/opensolaris/opengrok/web/WebappListener.java (1 lines added, 11 lines removed)
web/enoent.jsp (2 lines added, 2 lines removed)
web/error.jsp (2 lines added, 2 lines removed)
22 |
22 |
<description>An address where OpenGrok can receive new configuration</description> |
23 |
23 |
</context-param> |
24 |
24 |
|
25 |
<!-- context-param> |
|
26 |
<param-name>DATA_ROOT</param-name> |
|
27 |
<param-value>/directory/containing/data</param-value> |
|
28 |
<description>REQUIRED: Full path of the directory where data files generated by OpenGrok are stored</description> |
|
29 |
</context-param> |
|
30 |
||
31 |
<context-param> |
|
32 |
<param-name>SRC_ROOT</param-name> |
|
33 |
<param-value>/directory/containing/src</param-value> |
|
34 |
<description>REQUIRED: Full path to source tree</description> |
|
35 |
</context-param--> |
|
36 |
||
37 |
25 |
<listener> |
38 |
26 |
<listener-class>org.opensolaris.opengrok.web.WebappListener</listener-class> |
39 |
27 |
</listener> |
Up to file-list src/org/opensolaris/opengrok/web/WebappListener.java:
| … | … | @@ -74,17 +74,7 @@ public final class WebappListener implem |
74 |
74 |
|
75 |
75 |
String config = context.getInitParameter("CONFIGURATION"); |
76 |
76 |
if (config == null) { |
77 |
String value; |
|
78 |
||
79 |
if ((value = getFileName(context, "SRC_ROOT", true)) == null) { |
|
80 |
return; |
|
81 |
} |
|
82 |
env.setSourceRoot(value); |
|
83 |
||
84 |
if ((value = getFileName(context, "DATA_ROOT", true)) == null) { |
|
85 |
return; |
|
86 |
} |
|
87 |
|
|
77 |
OpenGrokLogger.getLogger().severe("CONFIGURATION section missing in web.xml"); |
|
88 |
78 |
} else { |
89 |
79 |
try { |
90 |
80 |
env.readConfiguration(new File(config)); |
Up to file-list web/enoent.jsp:
| … | … | @@ -35,10 +35,10 @@ environment.register(); |
35 |
35 |
String rawSource = environment.getSourceRootPath(); |
36 |
36 |
String configError = ""; |
37 |
37 |
if (rawSource.equals("")) { |
38 |
configError = " |
|
38 |
configError = "CONFIGURATION parameter has not been configured in web.xml! Please configure your webapp."; |
|
39 |
39 |
} else { |
40 |
40 |
if (!environment.getSourceRootFile().isDirectory()) { |
41 |
configError = " |
|
41 |
configError = "The source root specified in your configuration does not point to a valid directory! Please configure your webapp."; |
|
42 |
42 |
} |
43 |
43 |
} |
44 |
44 |
String pageTitle = "File not found"; |
Up to file-list web/error.jsp:
| … | … | @@ -31,10 +31,10 @@ environment.register(); |
31 |
31 |
String rawSource = environment.getSourceRootPath(); |
32 |
32 |
String configError = ""; |
33 |
33 |
if ("".equals(rawSource)) { |
34 |
configError = " |
|
34 |
configError = "CONFIGURATION parameter has not been configured in web.xml! Please configure your webapp."; |
|
35 |
35 |
} else { |
36 |
36 |
if (environment.getSourceRootFile() == null || !environment.getSourceRootFile().isDirectory()) { |
37 |
configError = " |
|
37 |
configError = "The source root specified in your configuration does not point to a valid directory! Please configure your webapp."; |
|
38 |
38 |
} |
39 |
39 |
} |
40 |
40 |
String pageTitle = "Error!"; |
