Index: /main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in	(revision 25560)
@@ -220,4 +220,5 @@
 	phindbrowserclass.cpp \
 	pingaction.cpp \
+	ispersistentaction.cpp \
 	basequeryaction.cpp \
 	queryaction.cpp \
@@ -268,4 +269,5 @@
 	phindbrowserclass.o \
 	pingaction.o \
+	ispersistentaction.o \
 	basequeryaction.o \
 	queryaction.o \
Index: /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.cpp	(revision 25560)
@@ -512,5 +512,5 @@
 
 
-void add_all_actions(receptionist& recpt, userdbclass* udb, keydbclass* kdb) 
+void add_all_actions(receptionist& recpt, userdbclass* udb, keydbclass* kdb, isPersistentEnum isPersistentVal) 
 {
   // the list of actions.
@@ -535,4 +535,7 @@
 #endif
 
+  ispersistentaction *aIsPersistentAction = new ispersistentaction(isPersistentVal); 
+  recpt.add_action (aIsPersistentAction);
+  
 #if defined(USE_RSS)
   rssaction *arssaction = new rssaction();
Index: /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.h
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.h	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/cgiwrapper.h	(revision 25560)
@@ -31,6 +31,7 @@
 #include "receptionist.h"
 #include "userdb.h"
+#include "ispersistentaction.h"
 
-void add_all_actions(receptionist& recpt, userdbclass* udb, keydbclass* kdb);
+void add_all_actions(receptionist& recpt, userdbclass* udb, keydbclass* kdb, isPersistentEnum isPersistentVal);
 void add_all_browsers(receptionist& recpt);
 
Index: /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.cpp	(revision 25560)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.cpp	(revision 25560)
@@ -0,0 +1,83 @@
+/**********************************************************************
+ *
+ * ispersistentaction.cpp -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "gsdl_modules_cfg.h"
+
+
+#include "ispersistentaction.h"
+
+ispersistentaction::ispersistentaction (isPersistentEnum isPersistentVal) {
+  // this action uses cgi variable "a"
+  cgiarginfo arg_ainfo;
+  arg_ainfo.shortname = "a";
+  arg_ainfo.longname = "action";
+  arg_ainfo.multiplechar = true;
+  arg_ainfo.multiplevalue = false;
+  arg_ainfo.defaultstatus = cgiarginfo::weak;
+  arg_ainfo.argdefault = "is-persistent";
+  arg_ainfo.savedarginfo = cgiarginfo::must;
+
+  argsinfo.addarginfo (NULL, arg_ainfo);
+
+  isPersistentBool = (isPersistentVal==isPersistent);
+   
+}
+
+void ispersistentaction::get_cgihead_info (cgiargsclass &/*args*/, recptprotolistclass * /*protos*/,
+				   response_t &response, text_t &response_data, 
+				   ostream &/*logout*/) {
+  response = content;
+  response_data = "text/html";
+}
+
+
+bool ispersistentaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 
+			    browsermapclass * /*browsers*/, displayclass &/*disp*/, 
+			    outconvertclass &outconvert, ostream &textout, 
+			    ostream &logout) {
+				
+  
+ 
+  textout << outconvert
+	  << "<html>\n"
+	  << "<head>\n"
+	  << "<title>Is Persistent</title>\n"
+	  << "</head>\n"
+	  << "<body>\n"
+	  << "isPersistent: ";
+	  
+  if(isPersistentBool) {
+	textout << outconvert << "true\n";
+  } else {
+	textout << outconvert << "false\n";
+  }
+
+  textout << outconvert 
+	  << "</body>\n"
+	  << "</html>\n";
+
+  return true;
+};
+
Index: /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.h
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.h	(revision 25560)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/ispersistentaction.h	(revision 25560)
@@ -0,0 +1,60 @@
+/**********************************************************************
+ *
+ * ispersistentaction.h -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "gsdl_modules_cfg.h"
+
+#ifndef ISPERSISTENTACTION_H
+#define ISPERSISTENTACTION_H
+
+#include "gsdlconf.h"
+#include "action.h"
+
+// used to control if web server is persistent or not
+enum isPersistentEnum { isPersistent, isNotPersistent };
+
+class ispersistentaction : public action {
+public:
+  ispersistentaction (isPersistentEnum isPersistentVal);
+  virtual ~ispersistentaction () {}
+
+  text_t get_action_name () {return "is-persistent";}
+
+  void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
+			 response_t &response, text_t &response_data, 
+			 ostream &logout);
+
+  bool do_action (cgiargsclass &args, recptprotolistclass *protos, 
+		  browsermapclass *browsers, displayclass &disp, 
+		  outconvertclass &outconvert, ostream &textout, 
+		  ostream &logout);
+		  
+protected:
+  bool isPersistentBool;
+
+};
+
+
+#endif //!ISPERSISTENTACTION_H
+
Index: /main/trunk/greenstone2/runtime-src/src/recpt/librarymain.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/librarymain.cpp	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/librarymain.cpp	(revision 25560)
@@ -36,4 +36,5 @@
 
 #include "action.h"
+#include "ispersistentaction.h"
 #include "browserclass.h"
 
@@ -96,5 +97,5 @@
   keydbclass *kdb = new keydbclass(gsdlhome);
 
-  add_all_actions(recpt,udb,kdb);
+  add_all_actions(recpt,udb,kdb,isNotPersistent); // apache (without mod_gsdl) is not a persistent server
   // Note: these actions will become invalid at the end of this function. 
   // => We will retrieve them from the receptionist and delete them
Index: /main/trunk/greenstone2/runtime-src/src/recpt/mod_gsdl.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/mod_gsdl.cpp	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/mod_gsdl.cpp	(revision 25560)
@@ -84,4 +84,5 @@
 
 #include "action.h"
+#include "ispersistentaction.h"
 #include "browserclass.h"
 
@@ -267,5 +268,5 @@
   // whatever that might be called in reality?
 
-  add_all_actions(recpt,udb,kdb);
+  add_all_actions(recpt,udb,kdb,isPersistent); // apache is a persistent server with mod_gsdl
   add_all_browsers(recpt);
   
Index: /main/trunk/greenstone2/runtime-src/src/recpt/win32.mak
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/recpt/win32.mak	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/recpt/win32.mak	(revision 25560)
@@ -272,4 +272,5 @@
 	phindbrowserclass.cpp \
 	pingaction.cpp \
+	ispersistentaction.cpp \
 	queryaction.cpp \
 	querytools.cpp \
@@ -321,4 +322,5 @@
 	phindbrowserclass.obj \
 	pingaction.obj \
+	ispersistentaction.obj \
 	queryaction.obj \
 	querytools.obj \
Index: /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp	(revision 25559)
+++ /main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp	(revision 25560)
@@ -60,4 +60,5 @@
 #include "pageaction.h"
 #include "pingaction.h"
+#include "ispersistentaction.h"
 #include "queryaction.h"
 #if defined(USE_SQLITE)
@@ -348,4 +349,5 @@
 pageaction *apageaction = NULL;
 pingaction *apingaction = NULL;
+ispersistentaction *aIsPersistentAction = NULL;
 tipaction *atipaction = NULL;
 queryaction *aqueryaction = NULL;
@@ -574,4 +576,10 @@
     apingaction = new pingaction();
     recpt.add_action (apingaction);
+  }
+  
+   if (aIsPersistentAction == NULL) {
+	// server.exe is persistent, so passing enum value isPersistent
+    aIsPersistentAction = new ispersistentaction(isPersistent); 
+    recpt.add_action (aIsPersistentAction);
   }
   
