• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programtic validation of JSF 2.0 pages during a build?

 
Jeffrey Getzin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We have a build process that uses Apache Ant to build our WAR. Along the way, it compiles the JSP, which has the side benefit of revealing any errors in our JSP files at compile time instead of at runtime.

Now we're starting to use JSF 2.0, and one of the things I'm starting to realize is that there does not seem to be any way to perform this same kind of validation at build time for JSF files. Am I mistaken? I've been searching the web for a fair bit of time now with little results.

Certainly, it must be achievable. We use MyEclipse to develop, and for all its flaws, MyEclpse is able to do some rudimentary validation of our JSF 2.0 files. So surely, there must be a method out there. (And don't call me Shirley!)

Anybody know of any such mechanism(s)?

Thanks,

Jeff
 
Jeffrey Getzin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh man, don't you hate when you make a typo in a message title? :-)
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I, of course, never maek mistakes.

This is an interesting question. The preferred format JSF views are XML, so an XML validator can catch a lot of that kind of stuff at edit time.

However, where I usually get stung is in the EL parts, and EL has the same liability as JavaScript, Ruby, Python and other "Git 'R Dun!" interpreted languages. You don't REALLY know if everything's properly defined until you execute it. Which means, of course, that instead of embarrassing you back in development as management screams "It is ready yet? All You Have To Do Is...", you can speed the code into production and have it explode spectacularly in front of the whole world on the 15th of March after having run perfectly for a month.

Still, I'm sure people are working on this, so hopefully we'll see some contributions here.
 
Jeffrey Getzin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I know it can be done because, as I mentioned, the latest version of MyEclipse does an adequate job of catching most errors. (It's got some bugs still, but it's only a milestone release.)

I'm particularly worried not about syntax, but about class resolution. What if someone forgets to check in a Java managed bean file and the JSF page references that bean? A simple XML validator won't catch that, and neither would a mundane EL validator. To validate that, you'd actually need to match all the symbol references in the EL to all the available classes and methods and fields in the classpath!

Jeff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic