struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Higham" <st...@sjlt.co.uk>
Subject How to pretty print HTML from Struts
Date Sun, 30 Sep 2012 16:22:13 GMT
My Struts Views are made up of JSP and Tiles and the resulting HTML is
untidy to say the least. This causes problems when I try to compare it with
HTML mock-ups. To solve this I'm trying to use the JTidy library to pretty
print the HTML output to the browser.

 

I'm using the JTidyFilter configured as follows: -

 

     <filter-mapping>

       <filter-name>StrutsFilter</filter-name>

       <url-pattern>/*</url-pattern>

     </filter-mapping>

  

     <filter-mapping>

       <filter-name>JTidyFilter</filter-name>

       <url-pattern>/*</url-pattern>

     </filter-mapping>

 

This seems to be failing because the Struts Filter Dispatchers only pass the
request down the Filter Chain if it is not a Struts Request (e.g. *.action).
Therefore this config will try to pretty-print *.css, *.js, *.img etc. but
completely ignores the outputs of my actions.

 

Does anyone know a sensible way of pretty printing the Struts HTML output to
the browser?

 

Many Thanks,

 

Steve

 

Steve Higham

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message