You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bl...@apache.org on 2001/02/20 22:30:32 UTC
cvs commit: xml-cocoon/src/org/apache/cocoon/servlet CocoonServlet.java ParanoidCocoonServlet.java
bloritsch 01/02/20 13:30:31
Modified: src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java ParanoidCocoonServlet.java
Log:
no message
Revision Changes Path
No revision
No revision
1.1.4.59 +17 -3 xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.58
retrieving revision 1.1.4.59
diff -u -r1.1.4.58 -r1.1.4.59
--- CocoonServlet.java 2001/02/15 20:50:07 1.1.4.58
+++ CocoonServlet.java 2001/02/20 21:30:30 1.1.4.59
@@ -60,7 +60,7 @@
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.4.58 $ $Date: 2001/02/15 20:50:07 $
+ * @version CVS $Revision: 1.1.4.59 $ $Date: 2001/02/20 21:30:30 $
*/
public class CocoonServlet extends HttpServlet {
@@ -136,8 +136,22 @@
private String getClassPath(final ServletContext context)
throws ServletException {
StringBuffer buildClassPath = new StringBuffer();
- String classDir = context.getRealPath("/WEB-INF/classes");
- File root = new File(context.getRealPath("/WEB-INF/lib"));
+ String classDirPath = context.getInitParameter("class-dir");
+ String libDirPath = context.getInitParameter("lib-dir");
+ String classDir;
+ File root;
+
+ if (classDirPath != null && classDirPath.equals("")) {
+ classDir = classDirPath;
+ } else {
+ classDir = context.getRealPath("/WEB-INF/classes");
+ }
+
+ if (libDirPath != null && classDirPath.equals("")) {
+ root = new File(libDirPath);
+ } else {
+ root = new File(context.getRealPath("/WEB-INF/lib"));
+ }
buildClassPath.append(classDir);
1.1.2.2 +17 -3 xml-cocoon/src/org/apache/cocoon/servlet/Attic/ParanoidCocoonServlet.java
Index: ParanoidCocoonServlet.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/ParanoidCocoonServlet.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- ParanoidCocoonServlet.java 2001/02/15 20:50:14 1.1.2.1
+++ ParanoidCocoonServlet.java 2001/02/20 21:30:30 1.1.2.2
@@ -60,7 +60,7 @@
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/02/15 20:50:14 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/02/20 21:30:30 $
*/
public class ParanoidCocoonServlet extends HttpServlet {
@@ -136,8 +136,22 @@
private String getClassPath(final ServletContext context, RepositoryClassLoader classloader)
throws ServletException {
StringBuffer buildClassPath = new StringBuffer();
- String classDir = context.getRealPath("/WEB-INF/classes");
- File root = new File(context.getRealPath("/WEB-INF/lib"));
+ String classDirPath = context.getInitParameter("class-dir");
+ String libDirPath = context.getInitParameter("lib-dir");
+ String classDir;
+ File root;
+
+ if (classDirPath != null && classDirPath.equals("")) {
+ classDir = classDirPath;
+ } else {
+ classDir = context.getRealPath("/WEB-INF/classes");
+ }
+
+ if (libDirPath != null && classDirPath.equals("")) {
+ root = new File(libDirPath);
+ } else {
+ root = new File(context.getRealPath("/WEB-INF/lib"));
+ }
try {
classloader.addDirectory(new File(classDir));