Hi,
I have been trying to present a been as a portlet using a stylesheet.I have
downloaded jakarta-apache jetspeed1.3a1 I am getting problem while
recieving the content even though i gave a mapping file.I think this is due
to the castor that bundled with jetspeed.If i change the castor.jar,then
jetspeed is not working.When I have done the same thing using a JSP with the
latest Castor Its working fine.
Second thing is when I try to set the BaseURL for the mapping object
its not working,even though I gave absolute path of mapping file to mapping
object, it is not able to find the file except when the file is only under
certain directory.
Here is the sample of code. ........................
mapping.setBaseURL((aRunData.getServletContext().getRealPath("\\etc")));
/*not working I tried to set the path using
aRunData.getServletContext().getRealPath(".. which is also not working */
mapping.loadMapping(new
java.net.URL("file:///C:\\local\\tomcat\\webapps\\jetspeed\\map4myObject.xml"));
/*its not taking if it is under other folder even by specifying absolute
path */
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
StylesheetRoot sheet = processor.processStylesheet("mystylesheet.xsl");
/* taking correct stylesheet*/
processor.setStylesheet(sheet);
/** * Create a ByteArrayOutputStream to receive the result of the
transformation */
ByteArrayOutputStream baos = new ByteArrayOutputStream();
processor.setDocumentHandler(sheet.getSAXSerializer(baos));
/** * Pass the processor to the Marshaller as a DocumentHandler so that it
will marshal to
* SAX events instead of to xml text. This will drive the XSLTProcessor to
run the
* transform and output to the ByteArrayOutputStream. */
DocumentHandler handler = processor;
Marshaller marshaller = new Marshaller(handler);
marshaller.setMapping(mapping);
marshaller.setMarshalAsDocument(true);
marshaller.marshal(myobject);
/** * Print the result of the transformation to out. */
String content = new String(baos.toByteArray());
/* here the object data is missing */
html.addElement(content);
FileWriter fw= new FileWriter("frportlet.html");
fw.write(content);
fw.close();
..........................
operating System used : win 2000
web server Tomcat 3.2
jetspeed 1.3a1
java: jdk1.3.0
If you could tell me to resolve this problem, which will be very grateful.
Thanks.
Satish K Aytha.
Satish Kumar. Aytha.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev