John McNally wrote:
> 
> Rafal Krzewski wrote:
> >
> > Jon Stevens wrote:
> >
> > > > I think that Turbine does not compile on JSDK 2.0 for some two months,
> > > > and nobody is complainig. Maybe it's time to drop the support?
> > >
> > > Then that needs to be fixed. I'm complaining.
> >
> > Not my itch, sorry :-)
> >
> > Rafal
> 
> The usual method for getting some code fixed that was submitted which
> contains code that does not compile under a supported platform is to
> have the developer who submitted the code fix it.  It seems the classes
> in question are TurbineConfig and ContentURI.
> 
> You submitted TurbineConfig, though IIRC it was in response to requests
> by several people, so it may not be fair to ask you to fix it.  The fix
> for 2.0 compliance is to remove a couple unused methods, but they must
> be implemented in 2.2, so I do not see an easy fix other than to give
> notice of the needed changes or to provide an alternate implementation.
> 
> ContentURI is similar in that I only see an alternate implementation as
> the fix, but I think this can wait for someone to ask for it.
> 

I believe ContentURI can be easily fixed by using introspection like
in the following patch (didn't test it, just made sure it compiles. 
It's not my itch neither)

===================================================================
RCS file: 
/products/cvs/turbine/turbine/src/java/org/apache/turbine/util/ContentURI.java,v
retrieving revision 1.2
diff -u -r1.2 ContentURI.java
--- ContentURI.java     2000/12/08 19:07:13     1.2
+++ ContentURI.java     2001/01/17 18:20:12
@@ -59,6 +59,7 @@
 //Turbine
 import org.apache.turbine.util.DynamicURI;
 import org.apache.turbine.util.RunData;
+import java.lang.reflect.Method;
 
 /**
  * Utility class to allow the easy inclusion of
@@ -81,8 +82,13 @@
     {
         super(data);
         
-        //the Tomcat context
-        contextpath = data.getRequest().getContextPath();
+        try {
+            Method getContextPath = 
+data.getRequest().getClass().getMethod("getContextPath", null);
+            contextpath = (String)getContextPath.invoke(data.getRequest(), null);
+        } catch (Exception e) {
+            //getContextPath() unsupported
+            contextpath = "";
+        }
     }
 
     /** set the image and URI */

--
Raphaël Luta - [EMAIL PROTECTED]
Vivendi Universal Networks - Services Manager / Paris


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to