struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Printer Friendly Struts Form
Date Wed, 14 Sep 2005 01:25:48 GMT
Jeff Deskins wrote:
> Is there a way to display all inputs/textareas of a struts form as plain 
> text for a printer-friendly version of a page? 
> 
> This would be similar to how the readonly attribute of a form currently 
> works in struts, by changing all fields to readonly. However, in this case, 
> I am looking for something to change all fields to display just the values 
> instead of the inputs and textareas. This way I can use the same jsp in 
> combination with css to have a printer-friendly page by passing in a print 
> parameter to the struts form.

You don't need to do anything (Struts specific or otherwise) in your JSP 
other than provide the appropriate print stylesheet. Add the following 
to your JSP page:

   <link rel="stylesheet" type="text/css" href="print.css"
         media="print"/>

(note the 'media' attribute). Then, in print.css you can make whatever 
formatting changes you want for printed copy, including supressing input 
lables if you want.

This article might help shed more light:

   http://www.alistapart.com/articles/goingtoprint

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message