Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Tuesday, March 1, 2011

JSF Facelets: Templating


This morning I finished my initial research into templating using JavaServer Faces Facelets. This is pursuant to some work I've been doing over the last month or so and three articles discussed in last week's posting.

I've worked with templates in JSF, but never set them up from scratch except for a mindless shot at them 3 years ago using a book I didn't fully understand. It's not been too relevant to my work, except briefly when fixing a few bugs in MarketSplash pages. I'm not really a front-end guy, but I do support some twenty domains benevolently and this technology would come in handy.

So, yeah, a new article—always an article, right?

I've probably got some polishing to do, but the structure and most of the content is there. Casting around for the next thing to look into, I'm thinking Spring Web Flow. If so, there will be another article. Then I'll tuck back into my back-end world where I belong. There some exciting REST stuff coming up later this year.

Thursday, February 24, 2011

JavaServer Faces: Facelets


I've gone and done it: my first full, raging JEE-oriented tutorial, A Simple JSF Facelets Project, in almost three years. In that time I've chosen not to write formal tutorials for a lot of the sub-JEE technologies I've worked with since I felt that others had more than adequately covered the topics. Others like, and very especially, Lars Vogel.

However, I'm on my own again. Just as years ago I couldn't find a tutorial on JSP and servlets that worked (perhaps rather, I couldn't find any that still worked with the new releases of the Eclipse IDE and Web Tools Platform), I have been unable to find a tutorial on Facelets that works.

I've figured out what others have missed and have no explanation why they left their tutorials in a state of unworkability, but I have a theory. They just don't go back to show how to solve problems they forgot they had or answer questions others new to their topic will have, questions they had to answer for themselves, but moved on without taking notes. Their tutorials, once you've followed them and created a project in Eclipse, simply do not work. You're on your own. And others tell me that they've been unable to get anything to work either.

Well, as I'm fond of saying, I'm not the brightest Crayola® in the box. So, I have to take careful notes because often I find myself smack back in the same state of perplexity at why my Tomcat server won't start or why some JSF construct won't render. And if I don't know, there must be someone else who doesn't.

Recently, I exchanged mail with some guy from India who admitted to me that he had tried playing with JSF earlier last year, but just couldn't get things to work. His problem was the same as mine: libraries. The chaos in JSF/Facelet approaches needing JSTL, then no longer needing it in Faces 2.0, etc., libraries coming and going, what version of what library works with what version or versions of other libraries, etc. It's unconscionable. And without the seemingly innate intelligence of these tutorial and book authors who publish then run off to their next thing, I'm obliged to feel my way forward via trial and error, a process I loathe.

And that old, long-winded tutorial I wrote on JSP, servlets and setting up Eclipse? I still get e-mail out of the blue at least once per month thanking me for it. It's still relevant even though it's become mildly embarrassing after journeying so far down the Eclipse and JEE road. I need to rewrite it, to make it more relevant and fix the rather embarrassing admissions of perplexity in my explanations. Now that I know.

Today's tutorial also builds on two other, full-length articles I've written on exposing the recent research I've done on setting up a solid set of libraries to use for JSF, plus additional libraries for Facelets work.

And I show how to internationalize and localize the simple application.

Today's tutorial doesn't go as far as I'd like. I need to wax more forthcoming on aspects that need explaining. That requires much more effort and guesswork. There are also some navigational problems that would be more obvious if the little application did much more than it does. That's very important to fix.

But, I'm moving ahead with the next tutorial. It will be a demonstration of Facelet templating; I just haven't chosen what I'm going to show yet.

Down the road I have plans to integrate Spring web flow. It's a mountain of work I've set for myself.

Friday, February 4, 2011

Maven of Maven?

Hmmmmm... no, at least not for now. However, we've made some important strides in groking Maven as used in Eclipse development this week. Long used "as is, as already in place," Maven will henceforth be a tool clutched firmly in our own fist.

http://www.javahotchocolate.com/tutorials/maven.html

Saturday, August 21, 2010

Apache ant: something mean in our sandpile when we were children?



I'm always behind the times. For example, my definitive ant tutorial at Java Hot Chocolate.

I should have written this up almost a year ago when I was hot and heavy on it. Instead, I waited until I had a moment, something that never came.

I don't have time today either because I'm busy writing an important application for Android. However, I figure, while it's hot in my mind, while the ant build script I'm writing for my application is closer to what I'd want to present than the humongous thing I wrote last fall for GWAVA, which is proprietary anyway, I had just better do it.

Anyway, I've got it about one-half written today, mostly the ant stuff proper, and I'll finish the Eclipse integration stuff next week, which won't be much more to add in terms of column inches.

However, I'm really behind my time. Maven's been here for what, forever now?

I've been playing with Maven for a couple of years, but because of Eclipse, have just never made the leap. We use Maven at Avocent for our builds, but I haven't undertaken to integrate it for my own use at home yet. And, I still feel very intimidated by it. It's so easy, so powerful and yet so nightmare-ish when things go south.

One day, my Maven prince will come. (Ooooo, did I say really that?)

Thursday, August 19, 2010

BlackBerry: All in a day's work


I'm scrambling to get this done before leaving for the Utah Java Users' Group meeting tonight. I'm leaving as soon as I post this.

I've successfully put together a development environment and a Hello World application for BlackBerry. And, as usual, I've written it up concurrently so that a) I have a place to return to for links, information and to see what I've forgotten, and b) others can step up faster and easier, or so I hope.

This is an experiment after nearly three weeks of deep-ending in Android development, quite successfully so far, I might add.

Of course, the two display systems are radically different, so the code I write for one will not be reusable for the other unless I can figure out how to get a little MVC separation, my next project.

At least I'm "up and running" in BlackBerry.

Friday, August 6, 2010

Attaching sources to the Android SDK JAR in Eclipse


An annoying thing about Android development is that you can't easily penetrate down inside Android library code because of an inexplicably misguided decision by Google engineers who've all but disallowed it. I'll stop editorializing there because I'm trying to be kinder and gentler.

In the land of Eclipse, as long as you have the source, you can easily attach it (refer to it) from the IDE in such a way as to a) Ctrl-click an identifier to jump to its implementation or b) step down into it when running in debug mode.

I spent the greater part of today researching this problem. Much has been written about it, mostly bitter (and justifiable) complaining, but some have tackled the problem and tried to solve it. Maybe the solutions I read worked back a couple of years ago when they were inked on the Internet, but you could not prove it by my own experience following them.

I also found a lot of solutions required somewhat non-standard tools on your utility belt like git, Python and other stuff you might not ordinarily associate with Eclipse use and Java development. I'm no wimp, but my productive hours aren't ones I'll willingly spend on planet Geeky Prime just to show off my technical manhood.

In the end, I solved it (probably again 'cause I'm surely not the first) with help from a more recent website that graciously posts the source code in almost exactly the form I need it for association with Eclipse.

Pursuant to my great frustration and deep-seated desire for no one else to have to rack their brains over this, I've detailed it in my article on Android development on my Hot Chocolate site. See here.

I hope this solution saves more than one person a lot of time.