Mercurial > hg > digilib-old
changeset 52:36505ac4a334
13.8.2002 - [different files] : roc
- changed all hardcoded occurrences of /docuserver/digitallibrary to
work relative or take the path from the request URL. Introduced a
variable baseURL to hold the URL path (up to digilib.jsp etc.). Now
it should be possible to install digilib in other directories.
- removed xerces.jar. It seems not necessary any more (JDK 1.3.1, Tomcat 4.0.4)
author | robcast |
---|---|
date | Thu, 15 Aug 2002 23:40:15 +0200 (2002-08-15) |
parents | aa63c2f1c3ca |
children | 1e80635e3f8c |
files | client/digitallibrary/digicat.jsp |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/client/digitallibrary/digicat.jsp Thu Aug 15 23:40:15 2002 +0200 +++ b/client/digitallibrary/digicat.jsp Thu Aug 15 23:40:15 2002 +0200 @@ -8,10 +8,22 @@ DB.setConfig(getServletConfig()); // check if authentication is needed and redirect if necessary DB.doAuthentication(request, response); + +// calculate base URL string from request (minus last part) +String baseUrl = request.getRequestURL().toString(); +int eop = baseUrl.lastIndexOf("/"); +if (eop > 0) { + baseUrl = baseUrl.substring(0, eop); +} else { + baseUrl = "http://" + request.getServerName() + "/docuserver/digitallibrary"; +} + %> <script language="JavaScript"> +var baseUrl = "<%= baseUrl %>"; + // DEBUG //alert('DIR: <%= DB.getDocuPath(request) %> PAGES: <%= DB.getNumPages(request) %>');