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.

Tapestry 4.0 support in AppFuse's CVS

I spent the last couple of days upgrading AppFuse from Tapestry 3.0.3 to Tapestry 4.0.1. While the integration isn't as clean as I'd like it to be, everything works and all tests pass, so that's good. I did post a few remaining issues to the Tapestry mailing list, but there's nothing major. While the upgrade was frustrating (it took me 4 hours to figure out I needed "validators" instead of "validator"), I feel I know a fair bit more about Tapestry now. Furthermore, my experience on the Tapestry user mailing list was incredible. Yesterday, for every question I'd send, I'd get 2-3 replies in a matter of minutes. It was like having my own personal Tapestry consultant by my side. It goes to show that Tapestry is a thriving community, with a lot of folks willing to help out. Thanks guys - I really appreciate the help.

Update: You can view the FishEye Changelog to see what the upgrade entailed.

Posted in Java at Mar 31 2006, 05:49:25 PM MST 7 Comments

[TSSJS] Java Web Frameworks Sweet Spots BOF

I've finished composing my "Java Web Framework Sweet Spots" document and presentation for tonight's BOF at TSSJS. Unfortunately, the BOF is at 6:30 and Crazy Bob's wedding is at 6. So I won't be able to make it to the wedding, but I do hope to have a toast to Bob and his new bride. I have been successful in securing beer for the BOF, so you'd better get their early if you want a free one. Caesar's doesn't have kegs, so it's $6/beer and we've purchased 100 of them for attendees. After that, it turns into a cash bar. Thanks to Virtuas, Codehaus, SourceBeat and yours truly for pitching in for the free booze.

My presentation tonight will be short and sweet. Rather than going through each framework author's responses, I'm just going to highlight their "sweet spot" responses. This allows me to get away with creating a measly 8-page presentation, as well as have a more interactive session. I've taken everyone's responses to the 6 questions I asked, and compiled them in a document. This document is available on the Virtuas site, just click on the link below to download it.

» View Java Web Framework Sweet Spots

Posted in Java at Mar 24 2006, 05:27:24 PM MST 28 Comments

[TSSJS] Apache Geronimo Prime Time with Jeff Genender

I'm sitting in Jeff's talk now, getting ready to listen to him ramble on about Geronimo. The room is about half full, and it's one of the smaller rooms. However, people are still streaming in, and it's the furthest room from the main conference area.

Jeff started his presentation with a little "Open Source Arcade" fun. The cartoon depicted a pac-man game with JBoss and Geronimo and resulted in a loud applause from the audience. This talk is going to cover Geronimo's architecture, how to use it, how to configure it, what it doesn't have and address common concerns.

Geronimo is a conglomeration of best-of-breed open source projects. Rather than reinventing the wheel, Geronimo embraces and reuses other open source projects: Axis, MX4J, ServiceMix, Spring, ActiveMQ, Jetty, Tomcat, Derby, Tranql, Apache Directory Server and OpenEJB. There's many others, but these are the headliners.

Geronimo is a carpet roll. Just like a carpet, it allows you to roll-your-own application server. Rather than using all the pieces of J2EE, you can just pick the ones you need? Currently, Geronimo ships with a collection of pre-configured assemblies: j2ee-tomcat-server, j2ee-jetty-server, minimal-tomcat-server and web-jms-tomcat-server. The last two will be available in the 1.1 release. The nickname for minimal-tomcat-server is "Little G".

Why another J2EE application server? Because J2EE is now a commodity. You used to have to spend a lot of money for J2EE servers. Now open source projects have commodotize J2EE and flattened the landscape. Also, the other application servers are LGPL and Geronimo is Apache Licensed, which is much more friendly to businesses.

Geronimo isn't just an application server, but also a top-level apache project with a healthy and active community. There are many other components coming out of this project, including:

  • The Geronimo API/Kernel/Assemblies/App Server
  • GBuild - Open Source Testing
  • DevTools - Eclipse Plugin for Geronimo Application Development with the Web Tools Platform (WTP)
  • J2EE Specifications - open source versions, eliminating the jta.jar problem you get with Maven. In my experience, most of these work, but Geronimo's javamail implementation doesn't work last time I tested it.
  • Home for OpenEJB, ActiveMQ, ServiceMix, Yoko (Corba) and XBean - all stand-alone sub-projects.

The Kernel of Geronimo *is* what is known as Geronimo. It controls the component (GBean) Lifecycle. A GBean is the Glue, the Wrapper, a Plugin to the Kernel. It conforms to JSR-77, the J2EE Management Specification and controls lifecycle, running states and naming conventions. The GBean architecture allows for simple development - you just need to implement the GBeanLifecycle, declare the GBean in a Plan (IoC) and deploy it. Plugging in 3rd party components is easy - for example Apache Directory and Quartz. Jeff wrote an article showing how to do this.

Jeff is now walking through the directory structure, which is pretty standard:

bin
config-store
deploy
docs
lib
repository (similar to Maven 1's structure)
schema
var

If you're familiar with Tomcat, Geronimo's "bin" directory is very similar. There's startup.sh/.bat, geronimo.sh and you can also use java -jar ./server.jar to start the server. Apparently, many of the scripts were copied from the Tomcat project.

Interestingly enough, my MacBook Pro's battery has been *much* more efficient today. I've been running for about 2.5 hours and the battery says it still has over an hour left. I believe this is largely because I've had my airport turned off most of the day.

Geronimo's Web Console is one of the nicer looking consoles I've seen for application servers. The user accounts for this are set in $GERONIMO_HOME/var/security/users.properties. It was donated by Abock (sp?) and I believe it's built on Pluto. For deploying applications, you can use the web console, drop WARs/EARs into the deployer directory or use the deployer tool (deployer.sh). When using the deployer tool, you'll need to have a plan file.

A plan file is an XML document (external or internal depending on nature of plan file). It's a descriptor to extend your application (setup JNDI DataSources, etc.) and similar to jboss-web.xml and weblogic.xml. Embedded examples: geronimo-application.xml, geronimo-web.xml, geronimo-ra.xml. For external plan files, you can use any name for the file. This file describes the GBean's attributes and references, as well as its dependencies. There are many different types of plans to describe information: web, application, resource adapters, security, naming references, EJB, schemas (in $GERONIMO_HOME/schemas directory).

The $GERONIMO_HOME/var/config/config.xml is Geronimo's central configuration file and allows you to override default values, as well as configure (or disable) GBeans. However, you can use the web console to configure everything in this file - and often it's much easier.

Now Jeff is going to do a demo of deploying and configuring Roller on Geronimo. This should be good, especially since he expects Murphy's Law, "if something can go wrong, it will", to come into play. He's showing us the plan file and how he had to hide a few classes, to prevent Geronimo's classes from conflicting. Jeff tried to show us how Geronimo allows you to download JDBC Drivers from w/in the console. Doh! We're in a conference room without an internet connection. Jeff had a backup plan and was able to successfully create a connection pool. After creating a security realm, he deployed roller.war and it all worked.

What Geronimo doesn't have? It lacks full clustering with respect to EJB/JNDI/Distributed cache. It *does* have full clustering with session replication and fail-over for the Tomcat web component, which fits 90% of clustering use cases. Uses Tomcat Clustering GBeans. Also, it can't run with Java 5 (only with 1.4.2) b/c the Corba component doesn't work with Java 5.

Now Jeff is doing Q&A, so I decided to try out my connecting to the Net via Bluetooth. It's actually pretty fast, GMail is surprisingly fast. From Bandwidth Speed Test, here are my results:

Communications: 87.1 kilobits per second
Storage: 10.6 kilobytes per second
1MB file download: 1.6 minutes
Subjective rating: Slow

Posted in Java at Mar 24 2006, 01:39:01 PM MST

[TSSJS] Friday Morning: RIFE and Seam

This is my 2nd day in Vegas and so far this town is treating me fairly well. I haven't lost all of my money, but the $25/hand blackjack tables haven't been kind. Yesterday, I woke up with a glass full of Berocca next to my bed - which means I passed out before drinking it. I needed it too, Matt Filios won a poker tourney and a bunch of us enjoyed "bottle table" (with Kettle One vodka) to celebrate. Spendy and good, but painful the next day.

Last night, I heard it was Crazy Bob's bachelor party, so I went to bed early to avoid the debauchery. Julie and a good friend of mine are flying in tonight, so there will be plenty of that this evening. So after a good night's sleep, I'm up early and attending the conference. The first hour has a lot of good sessions: Introduction to Seam (Gavin), Dive into RIFE (Geert), OSWorkflow (Hani) and Transforming Enterprise Java into a Commodity (Geir).

I'm sitting in Geert Bevin's session titled "Dive into RIFE" and it's a pretty small audience - maybe 20 people. Geert is the CTO of Uwyn, a small custom application development company. He's the founder of RIFE and creator of many RIFE projects: RIFE/Crud, RIFE/Jumpstart, RIFE/Continuations, Bamboo (forum), Bla-bla List (RIA todo list), Drone (Information bot) and Elephant (blog).

What is RIFE? It's a full-stack component framework to quickly and consistently develop and maintain Java web applications.

  • Integrated layers allow you to quickly get results with a minimal amount of code
  • Best practices are enforced in a pleasant way, providing many additional features and a consistent approach throughout all applications
  • Components can easily be resused in many contexts
  • Creating maintainable applications is our first goal
  • A lot of attention goes to code-level developer comfort
  • Frustration reduction by instant changes and reloads
  • Creative solutions for difficult problems
  • Embraces established standards (XHTML, HTTP, SQL, ...)
  • Geared to developing web applications and doesn't abstract away too much
  • Everything besides the web engine is designed to be independently usable
  • Attention to the whole life-cycle of your application

Geer is now talking about all the different pieces of RIFE - how it has a JDBC abstraction like Spring JDBC, web services support (even publishing of RSS Feeds) and a content management framework. Now we're going to look at RIFE/Jumpstart.

What is RIFE/Jumpstart? It's a source archive that you unzip and run. It makes it easy to start with new RIFE applications and contains everything you need (including Jetty). It has immediate support for more common development environments (X-develop, Netbeans, Eclipse, IDEA and Ant). Geert just showed us a video of getting started with Jumpstart and how you can easily use X-develop to build and deploy the app to Jetty. The Jumpstart application currently uses JUnit, but since the RIFE teams is starting to use TestNG more and more, it's likely they'll change in the near future. RIFE Jumpstart looks similar to AppFuse, except they have the save+reload problem solved - using JVM HotSwapping.

Now I've moved to the Introduction to Seam session. Gavin King is the presenter and the room is packed. It's a big room, so that's saying a lot. Gavin is talking about JSF, how backing beans work and what's in the faces-config.xml. How does Seam compare to J2EE? Much simpler code. There's fewer artifacts (no DTOs). Less noise (EJB boilerplate, Struts boilerplate). More transparent (no direct calls to HttpSession or HttpRequest). It's also much more powerful for complex problems.

JSF is amazingly flexible and extensive. EJB interceptors support a kind of "AOP lite" and EJB3 is a powerful ORM engine. Everything (except for the JSP pages) is unit testable can be tested with JUnit or TestNG. For testing the view layer, Gavin recommends using Selenium.

A backing bean is often "pure glue" and is just noise. Furthermore, it accounts for more LOC than any other component. It doesn't really decouple layers, in fact the couple is more coupled than it otherwise would be. Gavin calls this "wedding cake architecture." These applications look good in the window, but don't taste good when you eat them. I get his point, but have to disagree on the taste of wedding cake. It's always been good at the wedding's I've attended. ;-)

By default, web applications in general do not work in a multi-window application. To make it work, it generally requires a major architecture change. A couple of other areas for improvement in traditional web applications: application leaks memory (not cleaning up session objects) and "flow" is weakly defined. Navigation rules are totally ad hoc and difficult to visualize. How can this code be aware of the long-running business process?

JBoss Seam - what does it do? It unifies the EJB3 and JSF component models. It simplifies Java EE 5, filling a gap. In addition, it integrates jBPM and makes it more developer-friendly. Deprecate so-called stateless architecture. Decouple the technology from the execution environment. Run EJB3 apps in Tomcat or in TestNG or use Seam with JavaBeans and Hibernate. Gavin is using Tomcat for the first time and thinks it's hot-deploy architecture is totally broken. Of course, he usually uses JBoss and never has a problem with hot-deploy. It's interesting to hear this from Gavin, especially since I've heard from others that Hibernate breaks the reloading - and it's not the server's fault.

I'm going to head to another session now, but I did look ahead at some of Gavin's slides. Interestingly enough, the jPBM pageflow definition's XML looks quite similar to Spring Web Flow. Speaking of flows, I heard an interesting comments from someone yesterday after they attended Geert's continuations talk. Apparently, after seeing his talk, they think that RIFE's continuations offer a much more elegant solution to pageflow than these "XML programming" mechanisms.

I tried to go to Hani's OSWorkflow talk, but he was doing Q&A when I walked in. Apparently, he finished 25 minutes early. Then I walked into Geir's talk only to find Dan Deiphouse finishing up an XFire talk. Oh well, there's nothing wrong with having a few minutes to mingle between talks.

Posted in Java at Mar 24 2006, 11:56:30 AM MST 7 Comments

Using JasperReports with AppFuse and Spring MVC

JasperReports LogoIt's been over a year since Gilberto wrote a message to the mailing list about how to use JasperReports with AppFuse's Spring MVC flavor. Now he's created a tutorial for how to use JasperReports in AppFuse. Thanks Gilberto!

I've seen a fair amount of howtos for Spring MVC + JasperReports. I've even written one myself as part of Chapter 6.5 in Spring Live. However, I haven't seen many articles detailing how to integrate JasperReports with other Java web frameworks. Are they out there and I'm just not seeing them? It'd be great if we could show how to integrate JasperReports with all the web frameworks that AppFuse supports.

Posted in Java at Mar 22 2006, 07:46:58 AM MST 6 Comments

Using Drools with AppFuse

Want to use Drools with AppFuse? If so, Drools on AppFuse looks like a nice tutorial. I saw a presentation on Drools at last month's DJUG (download presentation and source) and it's definitely a powerful (and easy to use) rules engine. TheServerSide.com has An Introduction to The Drools Project if you'd like to learn more.

Posted in Java at Mar 21 2006, 09:50:28 AM MST 4 Comments

Tech Meetup Thursday in Boston

From the comments in my last entry, it looks like there's a few folks interested in a "geek dinner" on Thursday in Boston. I don't really like to call them "geek dinners" because the name makes me think of a bunch of social misfits sitting around talking about bytecode manipulation. ;-) IMO, a better name is "tech meetup" - which follows the line of thinking we have for our Denver Tech Meetups: meet somewhere, drink some beer, eat some food - and talk about whatever.

If you're interested, leave a comment on this post and we'll try to come up with a good location. I'm game for anything - so I'll let you locals pick the spot. How does 7:00 Thursday night sound?

Posted in Java at Mar 14 2006, 08:11:09 PM MST 22 Comments

The Ajax Experience Redux

When I found out about The Ajax Experience, I was a little disappointed.

This is a show I'd love to attend. However, it ends the day before Mother's Day - WTF is up with that?! For those of us who happen to be family men and are planning on attending JavaOne, this sucks. If I want to attend The Ajax Experience, I'd have to fly back on Sunday and then fly back to San Fran on Monday for JavaOne. Booo hisss. Looks like I'll be missing this show.

The Ajax Experience I'll admit, I sounded like a winey little beotch when I wrote this. In reality, the opportunity to go to two shows in the same town in San Francisco is a dream come true. And some how, some way, I've managed to get Julie's blessing to do this. It's her birthday that Saturday, and Mother's Day that Sunday - yet I'm free and clear to goof off in San Francisco with a bunch of geeks. I love this woman. ;-)

Are you going to JavaOne? What about The Ajax Experience? If you're going to be in San Francisco that weekend, let me know - maybe we can grab a brewski at the Thirsty Bear.

Posted in Java at Mar 11 2006, 12:01:48 PM MST 7 Comments

Jetty 6 Maven Plugin now works with SiteMesh (and Equinox)

The 1.6 version of Equinox contains commented-out settings for Maven 2 Jetty Plugin. The reason these are commented-out is because this plugin didn't work with SiteMesh at the time. I checked again today, and it looks like they got it fixed. See Brett's post titled Developing with Jetty: Where Have You Been All My Life? to see why this plugin is so cool.

Using this plugin (or the JettyLauncher in Eclipse) makes it pretty damn easy to do develop Java webapps. There's no longer a deploy cycle, just save and refresh your browser. IMO, it's almost as good as using a scripting language or developing with HTML/CSS/JavaScript.

I'd love to see someone develop a TomcatLauncher, a WinstoneLauncher and Maven 2 Plugins for both. AppFuse works with Winstone 0.8.1 (a wicked fast servlet container with a good story behind its name).

In other Jetty news, Jan Bartel posted a nice tutorial today titled How To Use JOTM as the XA Transaction Manager in Jetty6.

Posted in Java at Mar 10 2006, 12:08:31 PM MST 4 Comments

Struts is (far and away) most popular web framework deployed on JBoss

From this month's JBoss Newsletter:

Here are the results of last month's poll that asked: What web application framework(s) do you use for your applications deployed on JBoss? (Multiple answers allowed)

  • Apache Struts - 59%
  • JavaServer Faces- 34%
  • Spring - 26%
  • Other - 13%
  • Tapestry - 6%
  • WebWork - 5%
  • Wicket - 1%

These results are certainly interesting. My guess is most "Other" frameworks are ones developed in-house.

Does this means I shouldn't ditch Struts 1.x support in AppFuse 2.0? Possibly, but since AppFuse works best for starting new applications - it makes sense to say "use the good stuff or you're on your own." ;-)

Posted in Java at Mar 10 2006, 07:02:29 AM MST 9 Comments