English 中文(简体)
在将XML转化为已部署的Apache 6.0时可能出现的错误
原标题:Possible errors when transforming XML in deployed Apache 6.0

I cannot display a transformed xml (transformed by xsls) when running a WAR file on a deployed Tomcat 6 server supplied to me, whereas when I run it on Tomcat which is on my machine it works fine.

法典:

    StringReader xmlInput = new StringReader(xmlString);
    InputStream xslInput = new URL(path).openStream();

    Source xmlSource = new StreamSource(xmlInput);
    Source xslSource = new StreamSource(xslInput);

    // XML result will be written to HTTP response.
    Result xmlResult = new StreamResult(response.getOutputStream());
    try {
        Transformer transformer = TransformerFactory.newInstance()
                .newTransformer(xslSource);
        transformer.transform(xmlSource, xmlResult);
    } catch (Exception e) {
        Log.err("xml xslt transform error");
        response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
        return ("return couldn t load file");
    }

如果道路是所部署的Tomcat服务器的Xsl文档的中程,可以通过GET的请求提供。

Why would this not work on the deployed machine?

我不敢肯定WAR档案是如何在服务器上运行的,我都知道,它运行在Tomcat 6.0服务器上,我无法看到服务器的产出,因为我的教授不愿意分享任何这些信息。

因此,我 asking问的是,什么是能够造成这种情况?

http://www.ohchr.org。

我已设法获得更多有关这个问题的信息。 首先,没有出现任何错误,该信封将获得200个身份。 第二点是答复中的文字,意思是,改革职能中某些部分的工作要么是转变,要么是书面反应。

问题回答

http://download.oracle.com/javaee/5/api/javax/servlet.html

请注意<代码>的道路 GetResourceAsStreamtake is relative to request.getContextPath(.

可在<代码>ServletContext上通过<代码><>代码>获取现有<代码>。

If the server has a firewall, getting the xsl file may result in an error.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签