I've a simple method to get the output from velocity and press to
jtidy and do some validation, see if it useful to you:


        public static String getHtml(final File location, final Body body,
final Context context) throws Exception {
                final StringWriter writer = new StringWriter();
                
context.templateMan.getTemplate(context).merge(context.templateMan.getContext(context,
body, location, new TestRequest()), writer);
                final ByteArrayOutputStream out = new ByteArrayOutputStream();
                final Tidy tidy = new Tidy();
                tidy.setXHTML(true);
                tidy.parse(new 
ByteArrayInputStream(writer.toString().getBytes()), out);
                //              System.out.println(out);
                return out.toString();
        }

On 10/11/05, Scott Edward Skinner <[EMAIL PROTECTED]> wrote:
> Is anyone using Velocity with Spring? What is the best way to incorporate
> JTidy? Looking over the VelocityView source, I see several places where I
> can intercept the Velocity output and send it to JTidy before passing it
> off to the response. Another possibility is to perhaps write a JTidy
> resolver and chain it to my VelocityViewResolver?
>
> -S
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to