I've been developing a custom tag that uses the RequestDispatcher.include
()
 method.  The trouble I'm finding is that if I have one of my custom tags
 embedded within another, the includes are written to the user in the wrong
 order.  The same code works fine on the ATG Dynamo platform.

 The source looks like this:-

 The jsp page the user actually requests has the following source:-
 <%@ taglib
     uri="http://www.csc.com/bbdotcom/customtags";
     prefix="e3" %>

 <e3:insert file="/templates/template.jsp">
   <e3:param name="title" value="Custom Title"/>
   <e3:oparam name="content">
 <td>
         <e3:insert file="/table.jsp">
                 <e3:oparam name="content">
                         Here's some content for you.
                 </e3:oparam>
         </e3:insert>
 </td>
   </e3:oparam>
 </e3:insert>

 /templates/template.jsp has the following source:-
 <%@ taglib
     uri="http://www.csc.com/bbdotcom/customtags";
     prefix="e3" %>

 <html>
   <head>
   <e3:valueof name="title">No Title</e3:valueof>
   </head>
 <body>
   <e3:valueof name="content"/>
 </body>
 </html>

 and the /table.jsp file looks like:-
 <%@ taglib
     uri="http://www.csc.com/bbdotcom/customtags";
     prefix="e3" %>

 <table>
         <tr>
                 <th>Heading 1</th>
                 <th>Heading 2</th>
         </tr>
         <tr>
                 <td colspan=2><e3:valueof name="content">No content was
passed</
 e3:valueof></td>
         </tr>
 </table>

 In Tomcat, the resulting page is written as:

 <table>
      <tr>
           <th>Heading 1</th>
           <th>Heading 2</th>
      </tr>
      <tr>
           <td colspan=2>Here's some content for you.</td>
      </tr>
 </table>

 <html>
 <head>
      <title>Custom Title</title>
 </head>
 <body>

 </body>
 </html>

 As stated above though, it comes out correctly in ATG's Dynamo v5.1.1
patch 2.

 The custom taglib reference states that body tags will write their bodies
 to a temporary cache which is then provided to the tag as part of the tag
 lifecycle.  Inspecting your code, it looks like you're writing directly to
 the "real" response object, ignoring the response object that is passed as
 a parameter to the include() method.

 Is the Tomcat version is misbehaving?

 I would like the tag to be able to run on any platform
 (obviously) so for it not to work on Sun's reference implementation is not
 good.

Regards,
Thomas Purcell
__________________________________________________
Solutions Architect, Business Integration Services
CSC
212 Northbourne Ave, Braddon ACT 2612
Ph: +61 2 6246 8412    Fax: +61 2 6246 8100    Email: [EMAIL PROTECTED]

Reply via email to