File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes JSP Parsing error with JRun Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP Parsing error with JRun" Watch "JSP Parsing error with JRun" New topic

JSP Parsing error with JRun

Katie McCann
Ranch Hand

Joined: Jul 24, 2000
Posts: 45
I've got a large JSP with a significant amount of HTML in it (about 40 pages if I printed it out). Currently the page is only HTML- no JSP tags except for:
<@% page buffer="100kb"%>
What happens is that when I run the JSP through JRun/Apache, it displays part of the HTML correctly, then shows a fragment of HTML code(something like "<img src ="http://" and then breaks off), and nothing else.
I have tried various buffer sizes, but no matter what I change the buffer size to, the same thing happens. In fact, the exact same thing happens if I have no buffer set at all- it's as if it's ignoring my buffer. I have tried running the page with both Jrun 2.3 and 3.0. Any suggestions?
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
Check the jsp page with a hex editor like UltraEdit. I've seen a similar problem and it wound up being a couple of charaters that where A0 instead of 20(space character) If you view the page in an editor, the A0 shows up as white space and isn't obvious. You may have something like this in your file.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Katie McCann
Ranch Hand

Joined: Jul 24, 2000
Posts: 45
Thanks for the suggestion. I just downloaded Ultra Edit and there are no "A0" characters instead of "20"s. One thing I did notice, however, is that every time there is a line break, there is both a "0A" (line feed) and a "0D" (carriage return). Could this have something to do with it? I am actually generating the JSP code via a Java program using the following I/O classes:
FileWriter fw= new FileWriter("Comparison_"+i+".jsp", false);
BufferedWriter bw= new BufferedWriter(fw, 100000);
PrintWriter pw= new PrintWriter(bw, false);
Then, using a series of pw.print() or pw.println() statements.
Katie McCann
Ranch Hand

Joined: Jul 24, 2000
Posts: 45
OK, I just found a solution on another board, and just thought I'd reply to my own topic for the benefit of anyone else reading this:
Jrun apparently has a problem with large chunks of HTML (my file was almost all static HTML for the moment). The solution is to intersperse the JSP with empty JSP tags such as:
<%=""%> . This will cause JRun to break the HTML into smaller chunks, and display the page correctly.
I agree. Here's the link:
subject: JSP Parsing error with JRun
jQuery in Action, 3rd edition