Hi again,

The following patch tries to address a few issues I've encountered.

- in build.xml, the tools.jar is assumed to be in $JAVA_HOME/lib/tools.jar. It
turns out that JAVA_HOME usually points to the jre/ directory inside the jdk/
directory, while the tools.jar is in the lib/ directory of jdk/. Something like
this:

jdk/
  jre/
    lib/
      no tools.jar here <-- this is where ${tools.jar} points to
  lib/
    tools.jar <--- it is really here

This is true at least on Sun's JDK 1.3.1 under Linux. Could somebody else
verify this? If this is the case on all the JDKs, the patch for build.xml fixes
the problem.

- the patch for ProcessingException adds a new constructor which allows
creating such an exception given some other one. This functionality is needed
so that the original stack trace is preserved inside the embedded exception.

- the patch for request.xsl adds xsp-request:get-session-id.

- the patch for xsp.xsl allows for initialization code to be generated at the
entry in the generate() method using the xsp:init-page element. Note that this
is not the same with the xsp:logic element placed before the first element
inside xsp:page. While the xsp:logic generates code which ends up before the
declaration of the generate() method, the xsp:init-page generates code right
inside generate(), before anything else is executed. This feature is useful in
some of the logicsheets I have here.

Please let me know what you think of these changes.

Greetings,
-- 
Ovidiu Predescu <[EMAIL PROTECTED]>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://sourceforge.net/users/ovidiu/ (my SourceForge page)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

Index: build.xml
===================================================================
RCS file: /Repository/Cocoon2/build.xml,v
retrieving revision 1.1.1.10
diff -u -u -I\$Id:.*\$ -I\$Revision:.*\$ -I\$Author:.*\$ -r1.1.1.10 build.xml
--- build.xml   2001/08/10 02:26:14     1.1.1.10
+++ build.xml   2001/08/14 03:04:57
@@ -211,7 +211,7 @@
     <!-- 
     The location of tools.jar, relative to the JAVA_HOME home. 
     -->
-    <property name="tools.jar" value="${java.home}/lib/tools.jar"/>
+    <property name="tools.jar" value="${java.home}/../lib/tools.jar"/>
 
     <filter token="Name"    value="${fullname}"/>
     <filter token="name"    value="${fullname}"/>
Index: src/org/apache/cocoon/ProcessingException.java
===================================================================
RCS file: /Repository/Cocoon2/src/org/apache/cocoon/ProcessingException.java,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -u -I\$Id:.*\$ -I\$Revision:.*\$ -I\$Author:.*\$ -r1.1.1.2 -r1.2
--- ProcessingException.java    2001/05/15 00:43:42     1.1.1.2
+++ ProcessingException.java    2001/07/14 02:04:54     1.2
@@ -27,6 +27,15 @@
     public ProcessingException(String message) {
         super(message, null);
     }
+
+  /**
+   * Creates a new <code>ProcessingException</code> instance.
+   *
+   * @param ex an <code>Exception</code> value
+   */
+  public ProcessingException(Exception ex) {
+    super(ex.getMessage(), ex);
+  }
 
     /**
      * Construct a new <code>ProcessingException</code> that references
Index: src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl
===================================================================
RCS file: 
/Repository/Cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl,v
retrieving revision 1.1.1.3
diff -u -u -I\$Id:.*\$ -I\$Revision:.*\$ -I\$Author:.*\$ -r1.1.1.3 request.xsl
--- request.xsl 2001/05/24 19:33:31     1.1.1.3
+++ request.xsl 2001/08/14 03:04:58
@@ -103,6 +103,12 @@
     </xsl:choose>
   </xsl:template>
 
+  <xsl:template match="xsp-request:get-session-id">
+    <xsp:expr>
+      (XSPRequestHelper.getSessionId(objectModel))
+    </xsp:expr>
+  </xsl:template>
+
   <xsl:template match="xsp-request:get-parameter">
     <xsl:variable name="name">
       <xsl:call-template name="value-for-name"/>
Index: src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
===================================================================
RCS file: 
/Repository/Cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
retrieving revision 1.1.1.4
retrieving revision 1.4
diff -u -u -I\$Id:.*\$ -I\$Revision:.*\$ -I\$Author:.*\$ -r1.1.1.4 -r1.4
--- xsp.xsl     2001/08/10 02:26:16     1.1.1.4
+++ xsp.xsl     2001/08/11 01:42:42     1.4
@@ -101,6 +101,9 @@
         * Generate XML data.
         */
       public void generate() throws SAXException, IOException, ProcessingException {
+            <!-- Do any user-defined necessary initializations -->
+            <xsl:value-of select="xsp:init-page"/>
+
             this.contentHandler.startDocument();
             AttributesImpl xspAttr = new AttributesImpl();
 
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to