Debugging JSP which creates HTML/JavaScript via JspWriter.print() and JspWriter.write()

I am debugging some old code with lots of servlets and JSP which create HTML/JavaScript via JspWriter.print() and JspWriter.write(). Right now only solution taht I can see is to watch for out.print and out.write (JspWriter.print() and JspWriter.write()) buffer in eclipse variable view and then ocassionally copy and paste code into notepad and then remove all those ,[two blank spaces] and ,[one blank space] which will eventually give "properly" formatted JTML with JavaScript.

eclipse debugger
Problem is that buffer flushes on every 8912 bytes. So, I was thinking maybe if I reduce ti (or set to zero?) I could have let's say "real time" preview of print and write. Should I try to decrease buffer size?

Anyway I was also wondering about is there some better, easier method to debug this?

Moreover, I wonder why the authors of original code were using interchangeably both JspWriter.print() and JspWriter.write()? line after line of code. Whet did they accomplish with that?

I know that The write() methods are inherited from the Writer super class. The write() methods can take int, char[], or String types. The print() methods of JspWriter are overloaded for many other types, such as boolean. In the example, the type of the list get() will invoke the corresponding overloaded pint() method for that type. Why not just using print() methods?
KPaxAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrcoffee365Commented:
Are you looking at the .java files generated by a servlet engine? out.write and out.print are slightly different.  out.print does a bit more for you, and therefore might be slightly less efficient.  Hence, when the servlet engine chooses to use out.write, they are doing so when it seems as if it will be sufficient, else it chooses out.print.

At this point you would have to look at the source code of tomcat itself, or whatever servlet engine you are using to get a more definitive answer.

If you were working with the original .jsp files, I would expect your question to be quite different.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.