This may sound totally stupid, but is a case of real life :(
I\'m able to display a HTML table with a \"virtual\" link name.
Something like this:
To the point, just write the same code in JSP as you would do in a Servlet class. You can practically copypaste it. Only ensure that you are not writinig any template text to the stream, this includes linebreaks and whitespace outside the scriptlets. Otherwise it would get written to the binary file as well and corrupt it.
If you have multiple scriptlet blocks, then you need to arrange them so that there's no linebreak between the ending %> of a scriptlet and the starting <% of the next scriptlet. Thus, e.g.
<%@page import="java.io.InputStream" %><%
//...
%>
instead of
<%@page import="java.io.InputStream" %>
<%
//...
%>