Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing from a JSP inside a frame

 
Timothy Lovern
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application, that is set up somewhat like a model view controller pattern.

A servlet is responsible for all the business logic, and a jsp is used to display theinformation to the user. (only rendering information is scripted inside the jsp)

The JSP is displayed within a frame, provided by another application. I cannot modify this application.

The JSP uses DIV's to force the output to fit within the frame and have scroll bars.

I need to be able to print the contents of the JSP page. Using the Windo.print() method from java script just gives me the portion of the frame that is visible. I need to print the entire jsp page, sans scroll bars, and not print anything my JSP is not responsible for.

In one situation, I know prior to displying the JSP that a print has been requested, in another, I don't. If the first situation is easiest to deal with, then I can probably get by with that for starters.

Thanks in advance.

Oh, I am learning HTML,JSP, Servlets, and JAVASCRIPT all at the same time on this project, so my knowledge base here is pretty weak.

Tim
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try to make a style sheet with the media print, when the page is printed this style sheet can hide the unwanted information.

http://www.meyerweb.com/eric/articles/webrev/200001.html

Eric
 
Timothy Lovern
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, ok thanks!

Now to explore CSS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic