velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carfield Yim <>
Subject Re: Spring and JTidy
Date Tue, 11 Oct 2005 15:47:43 GMT
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();
body, location, new TestRequest()), writer);
		final ByteArrayOutputStream out = new ByteArrayOutputStream();
		final Tidy tidy = new Tidy();
		tidy.parse(new ByteArrayInputStream(writer.toString().getBytes()), out);
		//		System.out.println(out);
		return out.toString();

On 10/11/05, Scott Edward Skinner <> 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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message