On Thu, Jun 15, 2000 at 12:40:20PM -0700, Jon Stevens wrote:
> now, what was that other problem we were having with the latest CVS of
> tomcat/turbine?

The reflection trick in RunDataFactory to call getContextPath is broken
now because it is trying to reflect a package-visibility class
(HttpServletRequestFacade).

> what is the solution?

I dunno right now. If there's a clever way anyone knows of fixing the
reflection to work that would be best.

The workaround I'm using is to remove the reflection and call
getContextPath directly. However that won't compile with JSDK2.0, and it
doesn't seem to even run with JServ - although I would have thought the
'catch (Exception ex)' would cope (?)

My patch is below anyway, but I don't think it should be put in CVS...

Sean


Index: RunDataFactory.java
===================================================================
RCS file: 
/products/cvs/turbine/turbine/src/java/org/apache/turbine/util/RunDataFactory.java,v
retrieving revision 1.12
diff -u -r1.12 RunDataFactory.java
--- RunDataFactory.java 2000/05/24 17:22:06     1.12
+++ RunDataFactory.java 2000/06/15 20:03:24
@@ -132,12 +132,9 @@
         
         // Allow Turbine to work with both 2.2 (and 2.1) and 2.0 Servlet API
         String scriptName = null;
-        Class jsdkClass = req.getClass();
         try
         {
-            java.lang.reflect.Method meth =
-                jsdkClass.getDeclaredMethod("getContextPath", null);
-            scriptName = (String)meth.invoke(req, null);
+            scriptName = req.getContextPath();
         }
         catch (Exception ex)
         {
-- 
Sean Legassick
[EMAIL PROTECTED]


------------------------------------------------------------
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