Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why is document viewing implemented in a servlet instead of a JSP?

0
Posted

Why is document viewing implemented in a servlet instead of a JSP?

0

A JSP engine preserves white space, such as carriage returns in a JSP file, when it translates the JSP into a servlet. Thus, when a non-ASCII document format, e.g. Microsoft Word, is streamed from the K2 Viewing service to the browser, the added white space may prevent the browser from properly rendering the document. You can map a servlet to a JSP, as shown in the sample templates: The VVStreamer class is a servlet written to stream documents, thus circumventing the JSP engine’s translation phase. The class file, VVStreamer.class, and java file, VVStreamer.java, for this servlet are located in the k2\samples\web\templates\jsp\WEB-INF\classes directory. Additionally, a copy is placed in k2\samples\web\examples\WEB-INF\classes directory for the web context examples. The k2\samples\web\templates\jsp\WEB-INF\web.xml file maps a URL with a JSP to reference this servlet. The mapping in the web.xml file is as follows: VVStreamer VVStreame

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123