Dan Donahue

Greenhorn
+ Follow
since May 10, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dan Donahue

I'm new to Linux and Tomcat.
I have installed Tomcat 8 on an Ubuntu server.

My issue is this: I have a bean that is performing a transform on an xml file using an xsl file. Inside the xsl file, there is an xsl import command:

<xsl:import href="iso_schematron_skeleton_for_saxon.xsl">

The xsl file that has this import statement is located outside the application .war context. These files are located in a folder under CATALINA_HOME, for example: CATALINA_HOME/MyDataFileFolder

When running Tomcat on a Windows machine, the skeleton file referenced above is placed in the tomcat/bin directory and all is well.

However, when running on Linux, the transformer throws a file not found exception when I place the skeleton file in the bin directory.

So, it seems to me that I should ideally put that file in the MyDataFileFolder and set up an Alias so that href="iso_etc." maps to that file location.

The problem is, the href above does not have a url path in front of the filename. To be more correct, the url is "/" + filename. And you can't use "/" as an alias.

Ultimately, my question is: how do I set up a mapping so that href="iso_etc.xsl" resolves to that filename in CATALINA_HOME/MyDataFileFolder. Detailed specificity is appreciated! :-)

Note: I am prohibited from editing the xsl file that contains the import tag, above.
8 years ago
Hello, Ankit

The discrepency between onload event function names was a typo...I was trying to make the code a little clearer in my post by giving the function name something more illustrative. The onload function is called "resultUpload()" in all cases.


However, I think I found the problem...or at least a workaround. I found some information (I do not have the reference here) about the "target=" attribute in forms. Apparently, if you have something like I have, that is a target with NO extension, (target='uploadFrame'), then IE becomes confused and is unable to interpret the response output correctly. IE uses the extension on the target name to determine how to handle any response text. Without an extension, IE makes (poor) assumptions.

When I changed the name of the iframe from 'uploadFrame' to 'uploadFrame.html', and change my form tag to include target='uploadFrame.html' , then I was able to see the expected response output in the frame in both IE and Firefox. (Firefox had always worked as expected.)
15 years ago
I have a form with action -> servlet and target -> iframe. The onload event for the iframe is set to a function that simply reads the text content of the frame:
[
<form method="post" src="MyServlet" target="uploadFrame" enctype="multipart/form-data" id="mainUploadForm">
....
</form>
<IFRAME id="uploadFrame" onload="resultUpload()" style="display:inline" name="uploadFrame" ></IFRAME>
<script>
document.getElementById("uploadFrame").onload = function() {doShowFrameContent(); }
</script>
]

Servlet processes form data and writes some text data (using response.writer) into the target/response:
[
...MyServlet code. doing some JSON stuff..
resp.getWriter().println(jsonStringer.toString());
]

Original calling page reads the iframe contents and displays text in an alert message.

Works fine in Firefox.

In IE7, data is written to the iframe (right-click on iframe, select "View Source", and I see the data in notepad).
But when I access the data, it returns empty html.

[
right-click on frame, and I see JSON data: {"result":"true","validDevices":0,"errorDevices":0,"companyDupes":26,"updatedDevices":0}
however, jscript code: alert(document.getElementById('uploadFrame').contentWindow.document.documentElement.outerHTML );
returns: <HTML><HEAD></HEAD><BODY> </BODY></HTML>
]

Note: I've used innerHTML as well, with the same result.

How can I access the {"result".....} data written to that iframe? "View Source" is doing it, how can I?

This is driving me nuts!!! Help!!!


15 years ago
I don't know if this is a Resin thing, a Struts thing, or pilot error:
I'm seeing a problem where my action pages -- e.g. MyAction.do -- seem to "get stuck"...they seem to get about 75% complete (according to the progress bar in the browser's status) and hang. However, if I click on "stop" and "refresh", the page immediately completes and things are just fine. This happens almost - but not quite - every time, and is independent of whether the .do action is instantiated from a forward mapping (in the struts-config file) or directly from a .jsp.
Anybody have any ideas what might cause such behavior?
20 years ago