RE: JSP Tags in an XSL Template?

2001-04-18 Thread Joe Latty

You can use the jsp tags. If change the extension from *.xsl to *.jsp and
then use the jsp as you would an xsl e.g.

<%@ page language="java"
import="com.stuff.yourStuff,
com.stuff.yourSchema"
errorPage="error.jsp" %>

http://www.w3.org/TR/WD-xsl">







true









We have done this many times.

Joe

 -Original Message-
From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]  On Behalf Of Kesav Kumar
Sent:   Thursday, 19 April 2001 5:58 AM
To: Orion-Interest
Subject:RE: JSP Tags in an XSL Template?

You can't use the jsp tags inside the xsl stylesheet.  You can pass
parameters to the XSL.

Declare  at the top of your xsl and while calling the
transformation you can pass values to the top level params.  If you are
using apache's xalan here is the way to pass values.

In your xsl

http://www.w3.org/1999/XSL/Transform">





stylesheet



In your java code write the following.  The following code is according to
the Xalan1.1.  You can see the xalan2 javadoc for the appropriate way of
transformation.  In xalan2 the setting of the parameters are in Transformer
class.

public static void Transform(String xmlSourceURL, String xslURL, String
outputURL)
  throws java.io.IOException,
 java.net.MalformedURLException,
 org.xml.sax.SAXException
{
  // Use XSLTProcessorFactory to instantiate an XSLTProcessor.
  org.apache.xalan.xslt.XSLTProcessor processor =
 org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor();
  // Set the stylesheet parameters
  processor.setStylesheetParam("linkURL", new
org.apache.xalan.xpath.XString("http://xxxlco.com/skldjf"))

  // Create the 3 objects the XSLTProcessor needs to perform the
transformation.
  org.apache.xalan.xslt.XSLTInputSource xmlSource =
new org.apache.xalan.xslt.XSLTInputSource
("foo.xml");
  org.apache.xalan.xslt.XSLTInputSource xslSheet =
   new org.apache.xalan.xslt.XSLTInputSource
("foo.xsl");
  org.apache.xalan.xslt.XSLTResultTarget xmlResult =
   new org.apache.xalan.xslt.XSLTResultTarget
("foo.out");

  // Perform the transformation.
  processor.process(xmlSource, xslSheet, xmlResult);
}

Kesav Kumar
Software Engineer
Voquette, Inc.
650 356 3740
mailto:[EMAIL PROTECTED]
http://www.voquette.com
Voquette...Delivering Sound Information


-Original Message-
From: Dave Ford [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 9:47 AM
To: Orion-Interest
Subject: JSP Tags in an XSL Template?


Is there anyway to embed jsp tags in an xsl template? For example:


  
   
   <%= request.getContextPath()%>/StyleSheets/style.css
   stylesheet
  


If not, is there a better way to add "parameters" to xsl template as I'm
attemting above with the context path?

Thanks,

Dave Ford
Smart Soft - The Java Training Company
http://www.smart-soft.com







sendRedirect, Apache and Orion

2001-03-14 Thread Joe Latty

Having set up Apache as a front end to Orion, as specked in OrionSupport, I
have a virtual host set up like this:

http://www.frontend.com/> >
ProxyVia On
ProxyPass /myapp http://rearend:8080/myapp  
ProxyPassReverse /myapp http://rearend:8080/myapp
 


In Orion web-site.xml  I have:
http://www.frontend.com/> " port="80" />

Orion is running on a different machine and all is well until;

String theUrl = "/somewhere.jsp"
response.sendRedirect(response.encodeRedirectURL(theURL));

This will now change the url from http://www.frontend.com/myapp
  to http://rearend:8080/myapp
  which loses my session.

How do I stop the sendRedirect prefixing the URL.

Joe  


 winmail.dat