I have a simple java code :
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new
StreamSource(pageXSL));
I have no problem using it in a main method but it doesn't work in a JSP
File.
For the pageXSL parameter I have the same problem when i use a relative or
an absolute path or when i use an inputStream with java.net.URL.
java.lang.ClassCastException: javax.xml.transform.stream.StreamSource
at
javax.xml.transform.sax.SAXSource.sourceToInputSource(SAXSource.java:154)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFa
ctoryImpl.java:877)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(Transformer
FactoryImpl.java:747)
at _xsl._jspSample__jsp._jspService(/At/xsl/jspSample.jsp:83)
at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
at com.caucho.jsp.Page.service(Page.java:398)
at
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:166)
at com.caucho.server.http.Invocation.service(Invocation.java:272)
at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:128)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:216)
at
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)
javax.xml.transform.TransformerException
....
Could you help me please ?
Ce message contient des informations confidentielles ou appartenant au
Cr�dit Lyonnais et est �tabli � l'intention exclusive de ses
destinataires. Toute divulgation, utilisation, diffusion ou reproduction
(totale ou partielle) de ce message, ou des informations qu'il contient,
doit �tre pr�alablement autoris�e. Tout message �lectronique est
susceptible d'alt�ration et son int�grit� ne peut �tre assur�e.
Le Cr�dit Lyonnais d�cline toute responsabilit� au titre de ce
message s'il a �t� modifi� ou falsifi�. Si vous n'�tes pas
destinataire de ce message, merci de le d�truire imm�diatement et
d'avertir l'exp�diteur de l'erreur de distribution et de la destruction
du message.
This e-mail contains confidential information or information belonging
to Cr�dit Lyonnais and is intended solely for the addressees.
The unauthorised disclosure, use, dissemination or copying (either whole
or partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration and their integrity cannot be guaranteed.
Cr�dit Lyonnais shall not be liable for this e-mail if modified or falsified.
If you are not the intended recipient of this e-mail, please delete it
immediately from your system and notify the sender of the wrong delivery
and the mail deletion.