Matt RaibleMatt Raible is a writer with a passion for software. 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.
You searched this site for "java". 1,857 entries found.

You can also try this same search on Google.

Spring 2.0 Kickstart Presentation

As promised, here are the details on Thomas Risberg and I's Spring 2.0 Kickstart Presentation:

I ran out of time during my talk, so I didn't get a chance to implement validation or show the Selenium tests I created. Oh well, I'll know better next time. I talked to a few attendees and they said they really liked the live coding stuff. Unfortunately, the presentation doesn't show me doing that - you'll just have to look at the code on the slides.

Posted in Java at Sep 26 2006, 11:39:00 AM MDT Add a Comment

Spring Forward 2006 - The Keynote

After a 1 and a 1/2 hour cab ride, I arrived at Spring Foward 2006 just in time for the opening keynote. It looks like I'll be doing a 2nd talk this afternoon as Clark Richey was unable to make the show. I was given a choice of talks, and I chose "Comparing Web Frameworks" because that's a fun talk to do.

Thomas Risberg introduced the show (and the new Philadelphia Spring User group site), and now Colin Sampaleanu is talking about Spring. Spring 2.0 is fully backwards-compatible. There's a huge user base that demands full backwards compatibility so their old code still works. Spring 2.0 will run on your existing infrastructure: Java 1.3, 1.4 or 5. It'll run on all major application servers, as well as a simple servlet container.

The first major new features in Spring 2.0 are the simpler (extensible) XML configuration, as well as new AOP mechanisms.

XML Configuration in Spring 2.0

  • Ability to define new XML tags to produce one or more Spring bean definitions
  • Tags out of the box for common configuration tasks
  • Problem-specific configuration (easier to write and to maintain)
  • XML schema validation (better out of the box tool support, code completion for free)
  • Exploits the full power of XML (namespaces, tooling, etc.)
  • Backwards compatible (full support for <beans> DTD, complete interoperability b/w classic and extended configuration)

JNDI Lookup example (Spring 1.2.x):

<bean id="dataSource" class="...JndiObjectFactoryBean">
    <property name="jndiName" value="jdbc/StockData"/>
    <property name="resourceRef" value="true"/>
</bean>

In Spring 2.0:

<jee:jndi-lookup id="dataSource" jndiName="jdbc/StockData" 
    resourceRef="true"/>

AOP in Spring 2.0

  • Simplified XML configuration using <aop:*> tags
  • Closer AspectJ integration (pointcut expression language, AspectJ-style aspects in Spring AOP, @AspectJ-style aspects in Spring AOP that are fully interoperable with ajc compiled aspects)
  • Build on strengths, eliminate weaknesses
  • Preserve ease of adoption (still zero impact on development process/deployment, easier to adopt)
  • Benefit from the power of AspectJ
  • Spring and AspectJ are still separate projects, but work close together since both projects' leads work for Interface21

AOP is about pointcuts:

  • Pointcuts give us the tool to think about program structure in a different way to OOP
  • Without a true pointcut model, you only have trivial interception
  • By integrating AspectJ's pointcut expressions in Spring AOP, it's a much more powerful AOP framework

Hot on the heals of Spring 2.0, Spring Web Flow 1.0 will be released. It's a full Spring subproject and part of Spring's web stack. Using SWF, you can capture a logical flow of your web application as a self-contained module, at a higher level. Another interesting project is Spring LDAP. It's a Spring subproject that simplifies LDAP operations - based on the pattern of Spring's JdbcTemplate. It encapsulates nasty boilerplate plumbing code traditionally required for LDAP.

Finally, Spring 2.0+ will support OSGI. So what is OSGI? It's an industry driven framework specification, with multiple implementations. It has a dynamic omponent model, based around the idea of bundles. It's a full component model with classloading (for isolation and versioning), lifecycle control definition, etc. It's the foundation of Eclipse's plugin architecture.

Why do you need Spring-OSGi? Spring-OSGi is an integration library for Spring in OSGi environments. For those that need it, allows a more powerful component programming model. Without Spring having to re-invent the wheel, ApplicationContexts become bundles that are able to import and export services with full isolation and integration into OSGi lifecycles. The project is moving along rapidly, with large amounts of interest and involvement from vendors such as BEA, Oracle, IBM members of the OSGi foundation and the general public.

Finally, don't forget about The Spring Experience 2006. It's 3 days, 55 sessions across 5 tracks, including: Core Spring 2.0, Core Enterprise 2.0, Core Web 2.0, Domain-Driven Design and Just Plain Cool.

Posted in Java at Sep 26 2006, 08:14:01 AM MDT 2 Comments

On the Road Again

This week is a travel week for me. However, it should be a bit more enjoyable than most "business trips". I'm at Denver's airport right now, getting ready to jump on a plane to Philadelphia. Tomorrow I'll be speaking at Spring Forward 2006. Thomas Risberg and I will be presenting a Spring 2.0 Kickstart session, with Thomas covering Persistence and me covering MVC. It should be a fun show, especially with the current speaker lineup. We've put together some good slides, as well as a sample application. I'll make sure and post a demo, the code, and the presentation following our talk.

I'm going to stay with a friend in Philly on Tuesday night, then head to New York City on Thursday. I heard there's a bullet train that'll get you there in an hour - so I'm going to try to catch that. Wednesday night, I'm crashing on a friend's couch, and then heading up to Boston on Thursday. Hopefully I can catch a train and make it there in a few hours. Julie is flying into Boston on Friday. We'll be enjoying a kick-ass weekend at a friend's wedding before flying home on Sunday.

The beauty of this "train trip through New England" is my EVDO card. Thanks to it, and a 2nd laptop battery, I should be able to work while I'm traveling. On my todo list this week is working on Spring Live and AppFuse.

Posted in Java at Sep 25 2006, 11:49:21 AM MDT 3 Comments

TSS runs on Tomcat?

Looks like TheServerSide.com runs on Tomcat - or at least that's what their 404 page says. I don't know which is better - TSS's 404, Javablog's 404 (blank page) or JavaLobby's. It's hard to believe that major sites like these don't have better 404 pages.

For those of you who want to add a 404 page to your Java-based webapp, it's as simple as adding the following to your web.xml:

    <error-page>
        <error-code>404</error-code>
        <location>/404.jsp</location>
    </error-page>

Props to InfoQ for implementing a 404 page, even if it is rather useless.

Posted in Java at Sep 21 2006, 12:28:22 PM MDT 10 Comments

Lessons learned from using VMWare, Ubuntu and Maven 2 in a Training class

Last week I taught a Spring 2.0 training class in Milwaukee, Wisconsin. This class was different from previous classes because I made a VMWare image of Ubuntu for students to use when doing the labs. They also used Maven 2 and all the computers were without an internet or network connection (yikes!). Eclipse was used for the IDE and Maven's Jetty plugin was used for any web development activities. I'm pleased to say it worked out pretty well, but there were a couple of things I thought I'd write down for others trying this approach.

First of all, this was my first experience using VMWare in a classroom setting. In the past, I've had students setup their own environments. I've also built machines at the training facilities - and had their staff ghost the image for students. I think having students setup their own environments is a good idea, but I've had mixed results. There's always some folks in class that have no interest in knowing how things are setup and would rather everything "just works". These folks are usually disappointed when they have to spend 20 minutes installing a bunch of software. There's always a couple who don't read the instructions thoroughly and install things in the wrong locations. And then you have the folks that want to work on their Linux or OS X laptops. I can generally work it all out b/c I know Windows, Linux and OS X - but this is generally not a good avenue for instructors unfamiliar with multiple operating systems.

The second method - building a machine at the training facility (or client site) and having it replicated - works very well. However, it's often difficult to get private courses (at client sites) to use this method, and students don't get to walk away with anything. The VMWare option, however, allows you to burn the image to a DVD and give students everything from the course, including the computer they worked on.

I've thought of using the VMWare earlier this year, but never seriously considered it until I spoke with Howard Lewis Ship at this year's OSCON. He said he'd used it for a couple classes, and it worked great. He gave me a sample DVD and I used it to start creating my DVD (thanks Howard!). The nicest thing about using this DVD was we were able to brand it for students, as well as setup all 18 machines in the classroom in less than an hour.

Here is a list of issues I found with using a VMWare setup in the classroom:

  • I downloaded the Ubuntu 5.10 image to begin with. After upgrading to 6.06 and installing all the standard Java development software (less than 100MB), my image was 8GB. I was able to shrink it to 4GB and zip it to 2GB, but it's still quite large. Maybe installing 6.06 from scratch would slim things down.
  • On my home machine (dual core AMD with 3GB RAM), the VMWare image ran very fast, with no noticeable performance issues. I used VMWare Server at home, and VMWare Player during the class because it didn't require a (free) serial number. I had it set to 768MB of RAM at both locations, but the machines were noticeably slower (and close to unusable) in the classroom. The classroom machines were 2.5GHz with 1.5GB of RAM.
  • Since I knew most developers would be Windows users, I gave students the option to have me build their Windows environment. One student took me up on the offer and the only painful part was getting the Maven repo to the students machines. I had the Windows setup software on the DVD, so I was able to use that, but then needed to copy my local Maven repo to a thumb drive to transfer that. In the future, I'll put the Maven repo (only 36.5 MB) on the DVD.

All in all, using VMWare in the classroom turned out to be a good experience. It's likely we'll use it for most of our classes, but we'll also fall back to setting up a Windows environment for those students who don't like Ubuntu. As far as using Maven 2, it's been working great too - most of the students didn't even know it was used b/c they did everything in their IDE.

Posted in Java at Sep 19 2006, 11:29:45 AM MDT 4 Comments

New Tutorial: Integrating JBPM into AppFuse

Ameer Ahmed has written a tutorial titled Integrating jBPM into AppFuse. If you're interested in using jBPM in your project, you may want to check it out. I'm sure Ameer would appreciate any comments on his work.

Posted in Java at Sep 15 2006, 02:01:59 PM MDT 10 Comments

There's nothing like finishing up a training class

There's few feelings as great as finishing up a training class. The aches and pains that sneak into one's bones after talking and standing for 4 straight days is amazing. This week, I've been in Milwaukee, training a bunch of folks on Spring and particularly the new features in Spring 2.0. I had a full classroom this week, 18 students, and a number of them where PHP developers moving to Java. I had a tough time convincing them that web development with Java was easier, but hopefully they enjoyed the class anyway.

Now I'm sitting in the Milwaukee Airport, getting ready to fly back to Denver. Once I arrive in Denver, I have 2 hours before my flight leaves for Vegas. Hopefully I can catch a couple naps in flight and recoup before tonight's crazy night in Vegas begins.

As far as airport security, it was easy getting through in Denver, but they stripped me of my toothpaste and hair gel here in Milwaukee. Oh well, I shoulda known.

Posted in General at Sep 15 2006, 01:26:54 PM MDT 2 Comments

Integrating Hibernate Validator with Spring MVC

Remember when I wrote about Better client-side validation with Prototype back in May? Ted Bergeron responded to my post with the following comment:

Now that I am using Hibernate Annotations Validator, I stopped using commons validator. You can use the hibernate validator without using hibernate for persistence. I wrote some jsp 2.0 tag files to handle binding my form fields with spring mvc, and I use reflection to check for the validation annotations. This makes it no work to have a js calendar for all Date fields, or have class="required" added to all fields that have a @NotNull annotation. I'd be happy to send you the code for appfuse 2.0.

Ted followed up by sending me the code. I took a look at it, and reviewed a well-written PDF he'd written for his work. I told him he should publish it as an article, hooked him up with some folks at IBM developerWorks - and voila! Ted's article, titled Hibernate can meet your validation needs was published yesterday. Nice work Ted!

I'm looking forward to trying to leverage Hibernate Validation annotations for all the web frameworks in AppFuse. Should be interesting hacking into the cores of the frameworks to modify how their validation engines work.

Posted in Java at Sep 13 2006, 11:17:46 AM MDT 14 Comments

What's a good portable USB Drive?

After finding Mark's HOWTO Rip DVD Movies To Your iPod Using Free Software, I've started ripping some DVDs to my hard drive. On the list: Top Secret, Old School and Office Space. I imagine my hard drive will fill up pretty fast, so I'm in the market for a portable USB (or Firewire) Drive. Know of any good ones? I'll probably head down to the Apple Store tomorrow and pick one up.

Monday I'm heading out on a whirlwind trip to Milwaukee, followed by a weekend in Vegas. I'm teaching a class where we use Maven 2, so it might be a good idea to take the Maven repo with me. Especially since it's rumored the classroom won't have internet access. The good news is I have an Ubuntu VMWare image that already contains all the necessary JARs. Hopefully I can convince all the students to use it.

Update: In a perfect world, I could use my 60 GB iPod as a fat USB drive. However, it doesn't just "plugin and work" on a Windows box like thumb drives do. Rugged

Update 2: I ended up getting the LaCie Rugged All-Terrain Hard Drive. It was a little pricy, but it's tough to assign a value to a backup drive. With 120 GB, I should be able to use SuperDuper! to clone my hard drive and have plenty of room for movies.

rsync -v -t -l -r ftp.ibiblio.org::maven2 ~/.m2/repository

...is a wonderful thing. Looks like the Maven 2 repo is currently at 7.28 GB.

Posted in Mac OS X at Sep 09 2006, 05:16:48 PM MDT 11 Comments

Integrating Compass with AppFuse and the Display Tag

ChenRanHow has written up a detailed tutorial on how to integrate Compass with AppFuse and the Display Tag. From his mailing list post:

Thanks ChenRanHow!

Another great tutorial was recently written by Luciano Fiandesio. If you're looking to use Quartz, checkout Luciano's (well styled) AppFuse and Quartz tutorial.

In other AppFuse news, FanYang has started translating the documentation to Japanese, Mike McMahon has converted the appfuse-hibernate module to annotations, CruiseControl is continually testing, Mike Horwitz has solved most of the "Maven doesn't read a WARs dependencies" issue, and Scott Ryan is still hard at work on the code generation plugin. Even better - we've asked Scott to come aboard as a committer and he's accepted. Welcome aboard Scott - we appreciate all the work you're doing.

As far as progress on AppFuse 2.0, we're almost done with the Maven 2 conversion. The only thing left is figuring out how to get Mike's maven-warpath-plugin to hook into the Eclipse and IDEA plugins to they generate project files correctly. After that, it's time to start on documentation. I'm still torn on if we should use Confluence or DocBook. However, after looking at Spring's documentation for the past week, I think DocBook is probably the better choice. Then again, Stripes' Confluence Wiki looks nice and organized.

What do you think? What's the best way to write documentation for an open source project? Which system do you prefer to read? From experience, I prefer reading Spring's documentation over trying to find stuff in WebWork's wiki.

We've had great success with AppFuse users contributing to the documentation via a wiki, and I'd hate to create a documentation system that gets away from that. Maybe a DocBook/Confluence combination is the way to go? It looks like the CeltiXFire folks are having a similar debate.

Posted in Java at Sep 09 2006, 12:51:40 PM MDT 6 Comments