Skip to content

Commit

Permalink
Added a shared Java constant for setting key server.servlets.called
Browse files Browse the repository at this point in the history
  • Loading branch information
luccioman committed Apr 2, 2018
1 parent 033f7c4 commit 2fd4d05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htroot/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static serverObjects respond(

// check if the basic configuration was accessed before and forward
prop.put("forwardToConfigBasic", 0);
if ((post == null || !post.containsKey("noforward")) && sb.getConfig("server.servlets.called", "").indexOf("ConfigBasic.html", 0) < 0) {
if ((post == null || !post.containsKey("noforward")) && sb.getConfig(SwitchboardConstants.SERVER_SERVLETS_CALLED, "").indexOf("ConfigBasic.html", 0) < 0) {
// forward to ConfigBasic
prop.put("forwardToConfigBasic", 1);
}
Expand Down
2 changes: 1 addition & 1 deletion source/net/yacy/http/servlets/YaCyDefaultServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ protected void handleTemplate(String target, HttpServletRequest request, HttpSe

if (targetFile.exists() && targetFile.isFile() && targetFile.canRead()) {

sb.setConfig("server.servlets.called", appendPath(sb.getConfig("server.servlets.called", ""), target));
sb.setConfig(SwitchboardConstants.SERVER_SERVLETS_CALLED, appendPath(sb.getConfig(SwitchboardConstants.SERVER_SERVLETS_CALLED, ""), target));
if (args != null && !args.isEmpty()) {
sb.setConfig("server.servlets.submitted", appendPath(sb.getConfig("server.servlets.submitted", ""), target));
}
Expand Down
3 changes: 3 additions & 0 deletions source/net/yacy/search/SwitchboardConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ public final class SwitchboardConstants {
*/
public static final String WORK_PATH = "workPath";
public static final String WORK_PATH_DEFAULT = "DATA/WORK";

/** Setting key of the property that collects the names of all servlets that have been used so far. */
public static final String SERVER_SERVLETS_CALLED = "server.servlets.called";


/*
Expand Down

0 comments on commit 2fd4d05

Please sign in to comment.