Upgrade to 0.9.9 Complete
I upgraded to the latest Roller CVS snapshot this morning. Let me know if you see any issues. It was a very smooth upgrade since I tested everything locally first.
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 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.
I upgraded to the latest Roller CVS snapshot this morning. Let me know if you see any issues. It was a very smooth upgrade since I tested everything locally first.
Today is my last day at my current client. It's been a great experience and the last couple of weeks have been particularly enjoyable. We demoed the app I've been building (a Job Posting/Resume Builder) this week and everyone loved it. It's now ready to go into production, so hopefully the "new guy" won't have to do much work. It's unfortunate that it couldn't go into production sooner - but they want to deploy on WebSphere instead of Tomcat, so they'll have to figure that out first.
I was originally scheduled to dive head-first into open source at EJB Solutions next week, but managed to wiggle my way into a week off. I was already planning on taking the 2nd week of June off to work on Spring Live - and now I get 2 weeks! I'm pumped to have two weeks off - too bad I have work to do. Oh well, I expect to work crazy hours and burn the midnight oil a lot. That way, I can spend the days playing with Abbie and giving Julie some much needed rest.
The best part? On Thursday, I'm flying out to San Diego to pick up my new VW Bus. My dad is going to meet me there and we'll be embarking on Raible Road Trip #8 to drive it back to Denver. This weekend I'm going to stock a toolbox to deal with any breakdowns along the way. It should be a good time - I love road trips. So if you don't hear much from me for the next couple of weeks, I'm probably writing or enjoying beers on the patio. ;-)
Mmmm, beeerrrr - have a good holiday weekend y'all!
I've always said the best way to learn a new technology is to get paid to do it. Do you live in Newton, MA or San Francisco and wanna learn Macromedia's Flex? If so, you might want to checkout these openings. I've heard stories that it sucks to work for Macromedia - but it's always cool to get paid to learn.
Download · Changelog. Less than two weeks ago, Tomcat 5.0.24 Stable was released. However, it had a small bug where two cookies would be issued instead of just one - so a hotfix was released. Today, I discovered that 5.0.25 Stable is already out with a whole bunch of other fixes. Since there seem to be no announcements about this release - I thought you might like to know in case you have an upgrade planned.
Tomcat tip o' the day: When you install a new version of Tomcat, clean out its webapps directory (rm -r $CATALINA_HOME/webapps/*) and remove the balancer.xml from $CATALINA_HOME/conf/Catalina/localhost/. The webapps directory contains a number of sample apps that do nothing more than slowdown server startup. I also typically delete the "admin" application since I don't use that either:
rm -r $CATALINA_HOME/server/webapps/admin rm $CATALINA_HOME/conf/Catalina/localhost/admin.xml
Lastly, don't forget to add a user with a "manager" role in $CATALINA_HOME/conf/tomcat-user.xml. This way you can use the slick Manager app (http://localhost:8080/manager/html) to install/start/stop/reload/remove webapps.
Update: After installing this release, I discovered that looking up a Mail Session in JNDI doesn't work. It's possible its a bug in my configuration, but it's worked fine on all previous 4.1.x and 5.0.x releases. Because of this, I recommend sticking with 5.0.19 or 5.0.24.
Update 2: This has been verified as a bug in 5.0.25.
I finally found time to fix a few minor bugs in AppFuse 1.5 Beta and update all the tutorials. Now there's 3 new HowTos for developing a Master/Detail page using Spring's MVC Framework. After writing the tutorials, I found a new appreciation for Spring's MVC. I really like its lifecycle and (if given the opportunity) I think I'll use it for my next project. Without further ado, here's the relevant links:
Enjoy!
BTW, if you live in Colorado and you want to learn more about AppFuse, Spring and AppFuse Light - stop by the Denver JUG on June 9th or the Boulder JUG on June 10th. I'll be talking at both events. As a teaser, here's the bullet points from my slide on AppFuse Light:
There's a good that was published today on JavaWorld.com: End-to-end internationalization of Web applications. I stumbled upon it via TheServerSide.com. I especially like the tip about using a hidden "dateFormat" field in conjunction with Commons Validator to validate locale-specific date formats. AppFuse could certainly use this. Did you know that AppFuse supports 4 languages out-of-the-box and has full i18n support (save for the date format thingy). Supported languages include: English, Dutch, Brazilian Portuguese and Chinese. I opted to use JSTL's i18n support in most areas rather than Struts. It's simply more portable when moving to other MVC frameworks like Spring and WebWork.
Today, I forgot my laptop at home and therefore didn't get a chance to do any real-time blogging. It was quite nice in fact. I realized I forgot everything about halfway into my drive (30 minutes) and decided it wasn't worth turning around. Therefore, it was a day for just sitting back and soaking it all in.
This was quite a conference. Never have I seen so many great minds and influential Java Gurus in one place. The speakers were awesome, and to make things even better - I got to meet and shake hands with most of them. Who says the community in Java sucks? I'll tell you what - the Java community in Colorado is rockin'! The online community in Java might be a little terse - but the face-to-face community is a different story.
Ugh - I just had one of those "write a huge long paragraph and then lose everything" moments. Who was at fault: a combination of IE and Roller. I accidently hit the back button and Roller kicked me back to the login page. When I clicked the forward button - Roller/IE didn't return me to my post -> hence I lost everything. Sometimes I hate webapps. Time to finish the rest of this post in an HTML Editor where I can hit Ctrl+S all the time.
The first session I attended this morning was Dave Thomas's Herding Racehorses and Racing Sheep. Thanks to
Carl Fyffe for recommending it. The first part of it was about how developers
have different levels of expertise and how they learn. Novices are productive and learn well if they have a specific set of instructions. This is in contrast to Experts - who are more efficient if they're given freedom and lack of
rules. Most folks in the room considered themselves Experts. Dave estimated the room's average was 4.5. From there, we
proceeded to talk about the fact that most developers think they're smarter than they really are. Lastly, Dave touched on
Personal Knowledge Investment and how we all need to take time to invest in our own knowledge. It's your #1 defense
against offshoring. You know its working if you still have a job at the end of the year. You know it's really
working if you're doing what you want to be doing, programming in your preferred platform. This talked rocked and I
highly recommend it.
After that I attended Rick Hightower's TDD for the Web Tier. It was a good talk and I learned about jWebUnit. This tool is similar to HttpUnit, but it simplifies the API. It has the same functionality as Canoo's WebTest - allowing to easily
test interactions on a web page. It looks like a great way to test your view layer, though I prefer Canoo. The main reason is
because Canoo Tests are a bit simpler to write - especially if your QA folks are writing them. I had some success with this at Comcast - where our QA guy actually wrote quite a bit of XML to test our webapp. Rick also covered
Cactus fairly extensively (with examples) and a I learned some things about Cactus I didn't know. Cactus's beginXXX is for setting up client parameters, testXXX is for executing and testing
server-side code and endXXX is for testing the client side response (i.e. an HTML page). Rick definitely has a lot of experience with test-driven development and has motivated me to learn to use my IDE more
for testing. It's simply faster and therefore will make me a more efficient developer. Rick was saying that he
uses AppFuse with MyEclipse all the time. He says he hardly ever has to restart Tomcat and he can easily run XDoclet on a single file. The update for Eclipse 3.0 M9 is due out in a week - I might have to make an effort to get AppFuse to be MyEclipse-friendly then.
Julie and Abbie showed up for lunch and Abbie got to run around and wink at all the boys. It was cool being able to introduce them to all my "Java buddies."
After lunch, there was an Expert Panel Discussion where we talked about all kinds of topics: Hibernate, Personal Knowledge Investment, Tools/IDEs and of course, .NET. From there, I attended Rick's talk on AppFuse. It was great to hear Rick's perspective of AppFuse. When I talk about AppFuse, I tend to talk a lot about the reasons I created it and how it came to be. Then I talk about the technologies it uses. Rick talks more about his experience with it and how you develop applications with it. He had a lot of code to show and the talk went really well. Then again, I'm biased. I've never heard Rick speak before this weekend, and I have to say - he's a lot better than I expected. He has a lot of humor and experience in his talks and was quite enjoyable to listen to. I hope to work with him someday, that'd be a good time. If anyone is learning more about AppFuse, and you're local - I'll be talking about it at the Denver JUG and Boulder JUG next month. I also plan on releasing AppFuse 1.5 and AppFuse Light this week.
For the last session of the day, I attended Rod Cope's Easy Enterprise Applications with JBoss, Hibernate, AspectJ, and XDoclet. Rod is going to be my new boss in a week, so it was definitely cool to hang out with him this weekend. Rod is a good speaker, but his presentation wasn't teaching me much, so I left. He was talking about how extracting 75 lines of Hibernate code (many try/catches, lots of transaction/rollback code) into aspects can save you a lot of time. I don't use aspects, I use Spring - and my Hibernate methods are typically 1-3 lines of code. I'm sure if I'd stayed, I could've learned more about AspectJ - but frankly, it doesn't interest me that much.
I snuck out of the room and went to the 2nd half of Spring in Action by Craig Walls. I met Craig for the first time at this conference and I thoroughly enjoyed talking with him. He seems to be a very easy going guy and he definitely knows a lot about Spring. I learned some different ways of writing controllers - extending the Abstract Controllers, rather than using the Controller interface and SimpleFormController. It was interesting to see how flexible Spring is and how his way takes about the same amount of code as the way I'm doing it. It was a good talk and I look forward to downloading his sample app. Hopefully he'll post a link soon on his blog. I'd be happy to host a demo.
What a great conference. I left with a headache today because my brain was so full.
Tapestry - "we try to make the simplest approach the correct approach." I haven't been blogging much of this session b/c I'm just sitting back and
soaking it up. It's a good session and Howard is a good speaker. I'm learning a lot about Tapestry and it's philosophy about web development.
I especially like the line-precise error reporting - it's something that all frameworks need to do better.
Tapestry looks very cool. You basically
write an abstract Java class that has abstract methods for properties you define in an XML file. Tapestry them implements this class and its abstract
methods. The class that Howard wrote to handle a login form is very simple - it's only about 7 lines long - and 4 of those are abstract methods!
The HTML form is cool too - not much of the HTML
has changed since it was bare-bones HTML. He's merely added some a few "jcwid" and "listener" attributes to some of the elements.
Tapestry is a large system of subsystems, all implemented behind interfaces. It ships with its default behavior (i.e. page/template pooling), but you can
(supposedly) easily change this behavior or implement custom classes. Internationalization is a first-class citizen in Tapestry - no surprise here since it is
in most MVC frameworks. Tapestry 3.1 will embed Hivemind at its core and will provide much easier integration with tools like Hibernate and Spring.
Tapestry's "Validation Subsystem" looks very rich - providing both client side and server side validation. It uses Field decorations to highlight both labels
and fields when validation fails. By default, it promotes using CSS to change colors, backgrounds, etc. There are a couple of Helper Beans for validation:
the Validation Delegate and the Validator. It's pretty neat that you can bind a label to a field in XML. Since HTML already allows binding
<label>'s to form elements - you'd think that Tapestry could harness this by parsing the template. I suppose it's just easier to require the
XML binding - then you don't have to worry about the user writing invalid HTML.
Howard is trying something new in this presentation - real-time coding. I use this in my presentations and it works pretty good. He's having some serious issues b/c he can't mirror his laptop's monitor with the projector. This obviously makes it difficult to code since the slide show is his monitor. I try to use pre-canned code (i.e. IDEA Live Templates) so there's less chance of fat fingering things. I also use a Mac - on which mirroring works great.
The "Page" object is pretty cool in that it contains a bunch of lifecyle methods you can override. Most frameworks don't have lifecycle methods. I guess
Spring's SimpleFormController does with onSubmit, onBind. Lifecycle methods are a Good Thing IMO. The formSubmit() method is always called,
regardless of validation errors. Therefore, you have to get the IValidationDelegate and check if it has errors before continuing. I wonder what the logic
behind this is? Most frameworks seem to support automagical validation - with no further work required by the programmer. I guess it's kinda cool b/c you
can continue with validation errors if you want to. Choice is always a good thing.
Howard just showed us a client-side validation example. The wicked cool thing is that the client-side script is configured in a .page file rather than in the
HTML template. Most frameworks I've seen (that support client-side validation) require you put something into your template. This was a good
talk, I'm definitely interested in Tapestry and excited to start learning it in the next couple of months.
David is going to cover some JSF advanced topics: data table, tiles integration, custom components and validators. I was talking
with Rick Hightower last night. He mentioned that he's been doing a fair amount of work with JSF lately and really likes it. He
actually said he thinks he can develop a webapp faster with JSF than he can with Struts. He also said that JSF ships with a lot
of what you need - and a lot of the JSF books seem to cover how to add new stuff (custom components and validators) you don't need. This is to
say that the books tend to cover the features of JSF, rather than how to develop successful projects with JSF. I said I thought
it'd be nice if there were some JSF books by folks who'd used it to deliver applications. More of a "here's what you need to
know" kindof manual. I think that's what JSF needs.
The <h:dataTable> in JSF is pretty much the same as the <c:forEach> tag in JSTL. An interesting note on the JSF
expression language - it starts with a # instead of a $. For example:
<h:dataTable value='#{tableData.names}' var='name'>
...
</h:dataTable>
The major difference between JSF and JSTL's expression language is that JSF EL can access managed beans. The JSP 2.0, JSTL and
JSF expert groups are going to work together to try and synch up their expression languages. Personally, I don't see why the JSF
folks didn't just use JSTL and simply include managed beans in the lookup logic. Here's a wierd one - if you use any "template text",
i.e. in a dataTable - you have to wrap the text with <f:verbatim>text</f:verbatim>. David says this is one of the embarrasing
things about JSF. He hopes it'll be fixed in the next version.
The <h:dataTable> looks very similar to the
DisplayTag. Sweet - that's one less thing I'll have to worry about when creating a JSF app.
I've said it before and I'll say it again - my two favorite tag libraries are the DisplayTag and
Struts Menu. As I'm learning new frameworks, one of my major goals is to reproduce the same functionality I enjoy in my Struts+JSP
apps. It's been pretty simple so far with Spring and WebWork, since both support JSP. However, it might get a bit tricky with Tapestry
and JSF. I'm sure it'll be possible (and hopefully easier) to reproduce this functionality, it's just a big unknown
at this time.
"Form" beans in JSF are not like form beans in Struts. It's really just a class that doesn't extend anything and has action handler methods.
An interesting point - the actionListener's value (which is really a class.methodName) can be any class in any scope OR it can be a
managed bean. How about some code:
public class Form { public void changeLocale(ActionEvent e) { FacesContext context = FacesContext.getCurrentInstance(); Map requestParams = context.getExternalContext(). getRequestParameterMap(); String locale = (String) requestParams.get("locale"); if ("english".equals(locale)) { context.getViewRoot().setLocale(Locale.UK); } else if ("german".equals(locale)) { context.getViewRoot().setLocale(Locale.GERMANY); } } }
The major reason behind the FacesContext is to support Portlets. So rather than using a ServletContext or PortletContext, the FacesContext
provides a level of abstraction. The underlying theme of JSF: To be as flexible as possible. This is to say that there are many ways
to do things with JSF. I often think it's better to have less choices when learning a technology, but once you're versed in it - choices
are great. I guess I just wanna know the best way to do things, not all the options. Actions are for business logic, ActionListeners are for UI logic. ActionListeners are always fired before Actions - in the event
that you have an actionListener and an action defined for the same component. Listeners and Actions are really just methods on a class and they
can actually both be in the same class. JSF is starting to appeal to me. This session has been one of the fastest so far - there's only 20
minutes left and it feels like it's flown by.
JSF ships with converters for dates and currencies out-of-the-box - cool! Now David is explaining about a custom
CreditCard converter. This is what Rick was talking about last night. Why do we need to know this stuff? Would a normal talk on another MVC
Framework talk about converters and validation? I bet not. I think it's a good topic - maybe something that other frameworks should cover
more visibly. The Converter interface has two methods: Object getAsObject() and String getAsString(). The Validator interface has one method:
void validate(FacesContext context, UIComponent c). I just asked David about using Commons Validator instead of JSF's core validator. He said, "Yes,
it's possible." Sweet! You can use Commons Validator with Struts, JSF and Spring! Now if we could only get support for it in WebWork
and Tapestry - then I'd eliminate my need to learn another validation engine.
Now David is talking about using Tiles with JSF. It looks as simple as using the <tiles:insert> tag to insert dynamic content into an <f:subview>.
Any time you insert a tiles component, you need to wrap it in an <f:subview> tag. That was short - we're done talking about Tiles. I had some
questions - i.e. can you refer to a definition directly from an action or in the action's navigation definition? Oh well, onto custom components and renderers.
Custom components and renderers seems to me to be something that should be left out of these types of presentations. Sure, it's cool they're possible - but
who's using them? Have you needed them in a real-world JSF application? I only want to know the things I need to know to develop a real-world JSF webapp.
Sorry, I forgot - there aren't any real-world webapps written with JSF. If I'm wrong - send me a link. ;-)
This presentation was good - it inspires me to learn some more about JSF. Maybe there'll be some projects in my next gig that require JSF - that would
be wicked cool. After all, the best way to learn this stuff is to get paid to do it. If nothing else, I'll get to learn it later this year when I write
AppFuse's web layer in JSF.
For the 2nd session of the day, I've decided to attend the session on AOP. My choices were Converting
XML (Ben Galbraith), JSF (David Geary), What's new in EJB 2.1 (Monson-Haefel) and Runtime Code
Generation (Glenn Vanderburg). I asked David about his JSF presentation and he said it was "boring" so
I decided to skip it. This session, in the first 10 minutes, is pretty boring too. I might have to duck
out of this and attend another session - but none of the other sessions really interest me. This
one started this morning, and it seems to be a continuation of this morning session. It's mostly
on AspectJ and he's doing the good ol' logging example. I don't really have an interest in using
AspectJ since Spring's AOP is more than adequate for my needs. Oh well, I guess I'll stick around and
relax.
Ramnivas is using Eclipse to compile his aspects, and shows us how if he uses "javac" to compile everything,
no aspects are added. I'm guessing that there's some sort of plugin for Eclipse that allows for easy
compiling of aspects. A new feature in AspectJ 1.2 is the ability to set an ASPECTPATH and then use "aj"
rather than "java" to run code. This achieves the same effect as compiling the aspects in Eclipse. The "aj"
script appears to just set the system classloader.
Now Ramnivas is showing us how you can use an aspect to define pointcuts on internal appserver classes. His
example involves WebLogic, the J2EE Petstore and logging any EJB method calls. To use this, he has to
start WebLogic with a custom script, that has a custom classloader defined. For some reason, we're now talking
about log.debug() vs. if (log.isDebugEnabled()) { log.debug() }. Ramnivas
thinks that most folks don't wrap their debug statements (the proper way). Who doesn't know about this?! I'd
like to think that most developers are writing the 3-line version vs. the 1-line version.
An interesting quote: "So many things to show you - 3 hours is not enough." Maybe if we didn't have to
wait 2 minutes for WebLogic to start each time, 3 hours would be plenty. ;-) Ramnivas just added
logging to all the classes in the blueprints packages and then reloaded the page. There looks to be several
thousand method calls occurring behind the scenes for a simple page. Of course, there's lots of tag libraries - but
still - PetStore is a ridiculously complex application. Why did some ever impose this crap upon us as "best
practices" for Java. IMO, best practices should be based around simplicity, maintainability, testability and
performance. Does the PetStore even ship with unit tests? I'll bet it doesn't...
Now we're watching a pretty cool demo where Ramnivas is using aspects to enforce coding policies. In this
example, he's using aspects to enforce rules in EJBs (i.e. no static variables, swing or threads). It interesting
in that the aspects actually prevent compilation and display errors defined in the aspect. It's a neat idea, but
I'm suspicious in that a lot of this AspectJ stuff seems to be Eclipse-specific. What I mean by this is that
Eclipse seems to be required for compilation. Is it easy to aspect-enhance your classes using Ant? I would
hope so.
Ramnivas seems to be quite the AspectJ expert. He mentioned that he wrote a book for Manning and has mentioned
a couple of his contributions to AspectJ in this presentation. I admire authors that write and contribute to projects
at the same time. It's often an indicator that the person knows what the hell they're talking about.
This afternoon's first session choices are as follows: JSF Advanced Topics (Geary), Intro to J2EE Web
Services (Monson-Haefel), JSR166 (Glenn Vanderburg), Rhythm (Brian Boelsterli) and GUI Development (Ben
Galbraith). Web Services and Rhythm are 3 hour presentations, so I might stay away from those - that's just
too long for me. Now that I'm sitting in the 2nd half of a 3 hour presentation - it seems that these sessions
are best attended in the first half. It's almost as if the presenter is trying to find things to talk about
in the second half. Or maybe AOP is just a boring-ass topic. ;-)
I'd like to go to Brian's talk on Rhythm, since he's a good friend and mentor of mine. But then again, I
learned Rhythm from him - and use it daily - so I don't know that I'd get anything out of it. Advanced JSF
looks good, maybe I'll go to that one. For the 2nd session this afternoon, I'll probably attend Howard's
Creating Powerful Web Forms with Tapestry. Maybe I should stick with JSF and Tapestry and
make it a web-intensive afternoon. Both presentations are even in the same room!