#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    9
    Rep Power
    0

    Tomcat misreading files?


    This is a strange one. We had a bunch of old Word documents we wanted put on our web site. Since we don't have time to re-do them all, we saved them as html in Word, which as you probabbly know adds all that special Microsoft-only code to the page. Now we had to add a bit of JSP to these pages for security purposes. For the frist few pages this worked fine, then all of the sudden we started getting strange compile errors such as "Error at line -1: null" or "code too large for try statement" or "cannot read the file: ze file" as well as "out of memory" messages.

    It seems to me like Tomcat is trying to read the Word code (which does include things like {}) as JSP even though it's not between <% %> tags. Anyone ever heard of this happening, or know what we can do about it? Previously we had mixed JSP and Javascript without a problem, yet Javascript uses the same <!-- tags the Word code does. (And yes, we double-checked to make sure only real JSP was between the JSP tags). We also tried running the file through dos2unix and back again to no effect.

    Incidentally, our problem would be solved if we were able to set permissions on a directory. My senior said this can be done in plain Apache, but he'd never seen it in Tomcat. Anyone know different?
  2. #2
  3. No Profile Picture
    alt.sex.programming
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    26
    Rep Power
    0
    well, as for the w0rd documents...
    /<\/style>(.|\s|\S)*?<\/style>//ig
    /<([a-z]+) {0,}style=[^ ]+?([^>]*?)>/<$1$2>/ig
    /<br[^>]*?>/<br>/ig
    /<![^>]+?>//ig
    /<!--[^>]+?>//ig
    /<\/?[a-z]+?\:[a-z]+?>//ig

    theese should clean most of the micro$oft s|-|it (but also most of the formatting..., so you might wanna make backups)
    as for file permissions in tomcat...
    I don't believe there are one...(I really don't know much about tomcat, just installed it to run cocoon) but there (usually) is an administation tool that you might take a closer look at.
    *g* maybe you'll be wiser next time and work with an non-Microsoft Office suite so you're at least able to save the document as HTML.
    http://www.openoffice.org
    Last edited by linen0ise; June 14th, 2003 at 09:17 AM.
  4. #3
  5. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    If you attach one of the broken files so we can see it we may have more input.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    9
    Rep Power
    0
    We *think* we know what the problem is. The three files we're having trouble with are the three biggest we have (over 1 meg) so I think the Java virtual machine is honestly running out of memory trying to read them. And since it never reaches the end of the file, it thinks there an unmatched { or <. We're upgrading to a new development server next week anyway, so we'll see if that solves it.

    "maybe you'll be wiser next time and work with an non-Microsoft Office suite so you're at least able to save the document as HTML. "

    Oh, in the future they'll be done in plain HTML, believe me. But these documents were made long before we had the option of a website.

IMN logo majestic logo threadwatch logo seochat tools logo