cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: [C2] Regression in classpath generation
Date Wed, 21 Feb 2001 15:06:18 GMT
Robert Marcano wrote:
> 
>     Berin Loritsch wrote:
> 
> >
> > There are other ways of implementing security....
> > Anyhoo, I added two intial parameters for you:
> >
> > class-dir
> > lib-dir
> >
> > They represent _absolute_ paths to the directory, and are _only_ available in
> > the ParanoidCocoonServlet.  Please let me know if they work ok for you.
> 
> I tested these parameters, and didn´t worked for two reasons
>        WebSphere 3.5.2 doesn´t support yet ServletContext init
> parameters :-( (I changed it to use Servlet init parameters)
>        The two "if" used to detect if the parameters were defined uses a
> bad condition
> 
> I´m attaching the diff file

Thanks.  I caught one more bad condition, and committed the changes.

> 
> >
> 
>   ------------------------------------------------------------------------------------------------------------------------------------
> Index: ParanoidCocoonServlet.java
> ===================================================================
> RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/servlet/Attic/ParanoidCocoonServlet.java,v
> retrieving revision 1.1.2.2
> diff -u -r1.1.2.2 ParanoidCocoonServlet.java
> --- ParanoidCocoonServlet.java  2001/02/20 21:30:30     1.1.2.2
> +++ ParanoidCocoonServlet.java  2001/02/21 13:57:49
> @@ -136,18 +136,18 @@
>       private String getClassPath(final ServletContext context, RepositoryClassLoader
classloader)
>       throws ServletException {
>          StringBuffer buildClassPath = new StringBuffer();
> -        String classDirPath = context.getInitParameter("class-dir");
> -        String libDirPath = context.getInitParameter("lib-dir");
> +        String classDirPath = getInitParameter("class-dir");
> +        String libDirPath = getInitParameter("lib-dir");
>          String classDir;
>          File root;
> 
> -        if (classDirPath != null && classDirPath.equals("")) {
> +        if (classDirPath != null && !classDirPath.trim().equals("")) {
>              classDir = classDirPath;
>          } else {
>              classDir = context.getRealPath("/WEB-INF/classes");
>          }
> 
> -        if (libDirPath != null && classDirPath.equals("")) {
> +        if (libDirPath != null && !classDirPath.trim().equals("")) {
>              root = new File(libDirPath);
>          } else {
>              root = new File(context.getRealPath("/WEB-INF/lib"));
> 
>   ------------------------------------------------------------------------------------------------------------------------------------
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Mime
View raw message