Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

JTidy Filter

For those folks looking for pretty HTML when doing a "view-source", they might want to check out the JTidy Filter. I tried to integrate this into AppFuse, but no dice. It never prettied up the HTML - maybe it's a SiteMesh conflict or something, who knows. I doubt I'll add this to AppFuse. Mostly because no customer/project has ever asked for this and because I couldn't get it to work (failed the 10 minute test, but I actually spent an hour on it).

Posted in Java at Feb 09 2005, 09:11:59 AM MST 9 Comments
Comments:

Did you try NekoHTML ( http://www.apache.org/~andyc/neko/doc/html/ ) ? I had better results using it to cleanup HTML then with JTidy.

Posted by Ugo Cei on February 09, 2005 at 11:19 AM MST #

I've heard of (and use) NekoHTML, but AFAIK it doesn't have a Servlet Filter that ships with hit. I was looking for a simple drop-in-and-configure solution.

Posted by Matt Raible on February 09, 2005 at 12:10 PM MST #

It would be nice to have such a feature IMHO. I think such a function would be VERY important for newbies sice they try to learn and to understand what are the differend framworks and tags generating, and if the "view source" is useless, very few of them will save and reformat the content.

Posted by Ahmed Mohombe on February 09, 2005 at 04:11 PM MST #

I don't think such feature is useful. Why add extra load for a filter that only beautifies HTML code? If one wanted to view a beautiful HTML code, then JTidy (or any other HTML code beautifier, or text editor) should be plugged to the client software (e.g. viewing the HTML code with Ultra Edit). - Not everyone needs to view the HTML source code - Not every page will be viewed by those who want to view the HTML source code I don't see any real return value for plugging such filter to AppFuse, on the other hand, I get the impression AppFuse is getting bloated.

Posted by Jason Barker on February 09, 2005 at 04:38 PM MST #

Jason - I agree that it's a nice-to-have for about 1% of developers. If I ever got it to work, I'd likely just write a tutorial for it, rather than adding it. IMO, if you can't read the HTML that AppFuse produces, maybe it's time to find a new line of work. ;-)

Most of the stuff in AppFuse is stuff I've found truly useful. The recent addition of Acegi Security seems like a bit bloat of to me, but that's because I didn't need 2 JARs, 4 filter-mappings and one XML file before I added it. That being said, I think it adds value, but it'd be nice if it's configuration was as easy as dropping in a JAR, maybe overriding some default beans and configuring a single filter and its mapping.

Posted by Matt Raible on February 09, 2005 at 04:47 PM MST #

Matt,

For me, I don't think JTidy's strength is in beautifying the generated HTML but in validating (and correcting) it.

I use it to validate HTML entered by users, to ensure that the HTML output will validate as XHTML,

Posted by Carl Fooks on February 09, 2005 at 06:55 PM MST #

I agree that JTidy should be used for validation not beautification. I wrote a tidy filter myself a few years back that was very similar. It only did validation of course. We only used it during development and testing.

Posted by Michael Slattery on February 09, 2005 at 07:34 PM MST #

I just put JTidyServlet into my web application and PRAISE GOD for it! II do view->source all the time and I've needed this kind of functionality for quite some time now. Especially now that I'm writing JSF components. It seems like the FacesServlet outputs very few newlines.

Posted by Neil Griffin on July 21, 2005 at 06:41 PM MDT #

Hello Neil, I like to use the JTidy servlet Filter with Myfaces, Tomahawk and Facelets, but don't get it running. Can you post your configuration of JTidy here? Kind regards OK

Posted by Olaf Kossak on May 25, 2007 at 08:13 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed