Mmm, of course if you provide a patch for this it'll happen much faster ;)

On Jan 12, 2004, at 6:19 PM, Fredrik Lindgren wrote:

I agree that using a context based URL is the way to go. I would however suggest not going directly to the stream, but rather going through the step of getting the resource URL using context.getResource as an intermediate step. This would make it easier to keep cacheing the templates using the resource URL as the key. The changes to the current code would be small. When creating the StreamSource I would suggest using the two argument constructor providing the external form of the URL as the system id to enable use of relative URLs in the style sheets. This makes it easier to have modular style sheets. AFAIK relative URLs should work with jar file URLs as well.

Regards
Fredrik Lindgren

On Mon, 12 Jan 2004 15:28:15 -0500, Hani Suleiman <[EMAIL PROTECTED]> wrote:

You're right, it shouldn't use getRealPath, would anyone be upset if this is changed to use context.getResourceAsStream?

Eric Mckenna wrote:

Hello group,
Using Webwork 1.4 with tomcat 4.1.29 and have run into a problem when the
XSLTServlet tries to get the stylesheet for the action.
Here's the first part of the exception:
----------- javax.servlet.ServletException: XSLT Transformation failed:
javax.xml.transform.TransformerException:
Stylesheet null not found at
webwork.view.xslt.XSLTServlet.service(XSLTServlet.java:118)
-----------
along with lines 122-132 from XSLTServlet
-----------
protected Templates getTemplates(HttpServletRequest request)
throws TransformerException, java.io.IOException {
String uri = (String)
request.getAttribute("javax.servlet.include.servlet_path");
if (uri == null) {
uri = request.getServletPath();
}


String path = getServletContext().getRealPath(uri);
if (path == null) {
throw new TransformerException("Stylesheet " + path + " not found");
}
----------


After digging a little bit, getRealPath() doesn't work with war files.
Tomcat does expand the war file but that doesn't seem to help, since the
tomcat docBase attribute of Context is set to the war file. Using an
expanded directory and setting tomcat's context docBase to the expanded
directory allowed access to the stylesheet but I'd rather use a war file.


So, anyone know get around getRealPath when using a war file? And is there
a reason getResourceAsStream isn't used by XSLTServlet for getting the
stylesheet?


thanks,
eric.




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork





------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




-- Fredrik Lindgren


------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to