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.
You searched this site for "java". 1,588 entries found.

You can also try this same search on Google.

[Review] J2EE Design and Development

I finished reading Rod Johnson's J2EE Design and Development today. 700 pages took me a little over 2 weeks to knock out. This book is definitely targeted at experienced J2EE developers, which is nice. I tried to do the same with my Struts chapter in Pro JSP and I wish books would do more of it. However, the problem with targeting a more experienced audience is you lose a lot of potential buyers. Rod is definitely one sharp fellow and it shows throughout this book. Either that, or he's just got a lot of experience working with the J2EE stack in his career.

The framework described in this book eventually became Spring - and it's really just a culmination of all the things that Rod has used on his previous projects. In that respect, it's similar to AppFuse, which I created to assist me with my Java webapp projects. Like Spring, AppFuse contains all my learnings and choices over the last couple of years. Just to be clear, I don't mean to imply that AppFuse is anything close to Spring as far as functionality - but I do believe they're similar in their goals. Spring is designed to make J2EE easier, while AppFuse is designed to make project setup and testing easier. Hopefully, when I start using some Spring features in AppFuse, developing with AppFuse will become even simpler.

Back to the book. I found the first few chapters somewhat boring since they covered a lot of the stuff I already knew about J2EE applications. The middle part of the book was on Spring's simplified JDBC approach and it also covered EJBs. I tend to shy away from writing JDBC these days, especially since Hibernate suits my needs so nicely. If I'm working with an existing database and there's a lot of SQL code already, I'll use iBatis. And EJBs, blech - I've never had a need for them. Admittedly, a lot of my projects are small and don't require container-managed transactions. I've also heard rumors of CMT being a part of Spring - so who knows if there's any good argument for EJBs anymore. Anyway, I found the middle part of the book quite boring as well since I don't much care about JDBC or EJB.

The last part of the book, however, peaked my interest. It discussed MVC design, View Technologies (i.e. JSP, Velocity, XSLT, XMLC, PDF) and basically a lot of stuff related to the web tier. In this area, I was most impressed with XMLC, which allows you to write HTML pages - then use Java to manipulate it's contents. Very slick stuff for having a static prototype that also serves as the code for your app. I don't see myself switching from JSP to XMLC, but I dig the option. In the Performance Testing and Tuning chapter - great examples where given and seemingly real-world optimizations where made. This chapter could prove to be a handy reference for enhancing performance with simple caching.

Overall, I thought this was a great book, although a bit heavy on the EJB stuff for me. Now I'm motivated to learn more about Spring. In the process, hopefully I'll figure out how it makes iBatis and Hibernate easier to work with (links are most welcome). Next up is Java Open Source Programming(500 pages), which I expect to take another two weeks to polish off.

Posted in Java at Jan 18 2004, 01:38:52 PM MST 6 Comments

Alternative web frameworks for AppFuse

I've was thinking about the AppFuse Roadmap for a bit today - and it hit me. The hardest part of supporting frameworks like WebWork and Tapestry is going to be replacing the Struts features I'm confortable with. For WebWork, it should be fairly easy to replace Tiles with SiteMesh, but for Tapestry - does a templating framework even exist? Other things that might be hard to implement in Tapestry are the DisplayTag (although Erik Hatcher did mention it's easy to implement in Tapestry) and Struts Menu. I imagine doing something like implementing a menu with CSS/JavaScript isn't too hard in Tapesty - but can it be configured from an XML file and a Velocity template? Implementing these components into WebWork should be easy since it supports JSP, but Tapesty is a whole different animal. I've also heard that JSF already has a grid component - and the struts-faces library should allow me to use Struts Menu easily with JSF.

I guess the good news in all of this is that I will discover if this stuff is possible or not - instead of just wondering. If you do happen to know the answers off the top of your head - please let me know. The real question is - after all of this - which framework will I choose as my favorite. Stick around and read about my journey into these other frameworks from the perspective of a hardcore Struts developer and enthusiast. I don't plan on trying to prove that Struts is better - I just want to find the beauty of these other frameworks and report if it's all hype or actually true.

Posted in Java at Jan 17 2004, 09:24:47 PM MST 5 Comments

AppFuse 1.3 Released!

This release fixes a few compatibility issues with Resin and other databases - specifically PostgreSQL and DB2. The major new functionality in this release is Easy Database Switching. Basically, you can very easily switch from using MySQL to PostgreSQL by only changing a few properties in your build.properties. I implemented this on my current project last week because I do most of my development (at the client) on a PowerBook. The client wants to deploy onto a DB2 database - and there is not DB2 install for the Mac. Since Hibernate allows you to easily switch between databases, I figured I could develop using MySQL on the Mac, but have the default (CVS version) use DB2. One of the things I didn't want to do was to have a build.properties.sample, because I love projects that "just work" when you type "ant". So I changed the the build process so that database.properties is generated from default settings (MySQL) or the settings in build.properties (if specified). As part of the build process, Ant looks for the following build.properties files:

  • ${user.home}/.${ant.project.name}-build.properties
  • ${user.home}/.build.properties
  • build.properties

What this allows you to do is to take your customized database settings and put them in ~/.build.properties and they'll be applied to any AppFuse-derived project. This makes it easy to keep the CVS version of your project tied to one database and a developer's local version tied to a different database.

While it's true that you'll most likely only talk to one database during the duration of your project, this exercise proves that it's easy to migrate from MySQL to another database. It also proves that AppFuse can easily integrate with other database (at least as of this release). Slick stuff IMO.

One of the best parts about developing AppFuse is that it's not a library. As a developer, I don't really have to concern myself with backwards compatibility. This means that new functionality can be added quickly and easily and old stuff can be ripped out. It's too bad all OS "products" can be this easy.

What about AppFuse's future? Check out the AppFuse Roadmap to see what I'm thinking about.

Posted in Java at Jan 16 2004, 04:28:47 PM MST 1 Comment

[ANNOUNCE] Resin 3.0.5 Released!

View the Release Notes and Download. A couple of the bugs I found when running AppFuse on Resin have been fixed: <description> is now a valid property of <user-data-constraint> and the following JSTL statement should work as well.

<fmt:message key="login.signup">
    <fmt:param><c:url value="/signup.jsp"/></fmt:param>
</fmt:message>

Posted in Java at Jan 16 2004, 01:36:20 PM MST Add a Comment

A Wiki to Watch

If you're a Java Blogger, you know about Erik's weblog. If you don't, you're living under a rock. Today, Erik introduced his wiki, which is likely to be a hotbed of good Tips and Tricks. I subscribed to his wiki RSS feed. I've seen issues with my wiki's RSS feed (it says there's updates when there really isn't), so I hope his works better. I didn't realize my Redman Skin got published, but oh well - the download is only 12KB. The name is probably a bad one since it's easy to change the color scheme from Red to other colors (just change the link colors). At my current client, I changed everything to green, and I have to say - it looks a bit better than the red. One thing I've been meaning to do to this wiki template is support for a tabbed menu, I just haven't gotten around to it.

Posted in Java at Jan 15 2004, 05:52:17 AM MST 2 Comments

DJUG Meeting: The Future is Swing

I attended the Denver JUG meeting tonight and definitely enjoyed myself. It helped that I got to see an old friend, but it was also a nice refresher on XSL-FO and a great overview on J2EE UI choices. The basic concepts meeting was on XSL-FO, which as far as I know, is mainly used for creating PDF documents from XML content. Apache's FOP is widely used for doing XSL-FO in Java.

So here's a question for you - if I want to produce PDF versions of my resume (in struts-resume), which technology should I use? I know it'd be fairly easy with XSL-FO, but what about JasperReports? I'd like an easy way for users to be able to upload new "templates" for the PDF version of their resume, so FO might be the way to go. In addition, I'd also like to implement the PDF-rendering technology that I'll likely use on a real-world project. Are there some good APIs to use?

I did some XSL-FO work a couple of years ago and it seemed pretty cool, but it required a lot of trial and error to get things looking right (as is the case with most XSL). My favorite tool at the time was RTF2FO, which allows you to create a Word document with the look you want, save it as an RTF, and then convert it to a FO (.fo) document. Pretty slick stuff - it looks like they have a free trial and it's only $50/machine. The project I used it on was only 3 weeks, so the trail version did me just fine.

The main presentation was delivered by David Curry, who seemed to be an expert on J2EE UI choices.

David Curry is Director of Systems Development for ADP/SIS, part of the ADP Brokerage Services Group. He and his team use J2EE with DHTML, XML and Swing to develop mission-critical desktop productivity applications for brokerage and bond trading firms.

The main thing that impressed me was that David has been developing the same application since 1992. The app started out as a PowerBuilder desktop app, and moved to an HTML app, then DHTML - and now they're moving to Swing. They recently chose Swing (with the help of JGoodies) over their DHTML interface because 1) Java Web Start makes it much easier to deploy and 2) it's much more responsive for users on dial-up connections. David mentioned that it's a good idea to break your app into many separate jars so users don't need to update the entire app for new releases (a.k.a. JNLP Versioning).

I've often argued that you can make a webapp do almost anything a desktop app can do, but I can't argue with the bandwidth thing. It does take a long time to download a webapp that has a lot of JavaScript, CSS and images that make it rich. David mentioned that Gartner expects HTML interfaces to subside in the coming years, and for rich UIs (like Swing and SWT) to become more the norm. In one sense, I hope they don't - the only reason I'm in this industry is because of my HTML/CSS/JavaScript skills. It's all I know. Sure, I could probably learn Swing, and I might even like it, but I'd rather not. Learning Spring, WebWork and Tapestry sounds like more fun. Of course, if they can support a Swing UI, then I've lost nothing by learning them. I know WebWork does, but what about Tapestry? Is it view-technology-agnostic?

On the other hand, Swing does have some advantages:

  • There aren't as many choices. Desktop apps are desktop apps, they should look like them. A lot of webapp developers (including myself) can get caught up in making a webapp look like a great website. The web offers so many more choices for look-n-feel that it's hard to decide which is right. I spend more time tweaking UI code (JavaScript and CSS) than doing anything else.
  • Java Developers can develop the UI. In my experience, I have a rare set of skills - a strong HTML/CSS/JavaScript background, and a firm grasp of Java. The industry rumor is that there's HTML developers and Java Developers, but they're rarely the same person. David mentioned that there team is nicely consolidated to 6 developers - and everyone knows how to program in all layers. This sounds like smart management to me, moreso than Swing makes your team more efficient.

The other side of the coin is that Swing will never replace many webapps. For instance, it could never replace Roller. Why would readers want to download a Java app to read this site. However, since most of you probably use client-side aggregators and client-side editors, maybe the shift to desktop apps has already started...

Posted in Java at Jan 14 2004, 10:09:17 PM MST 6 Comments

MD-5 password encryption and the "secret key"

According to a post on the Struts User mailing list, it's possible to encrypt a password using MD-5 (which is one-way), stuff it into a cookie, and then use a server's "secret key" to verify that it's a good one. Since I'm guilty of storing base64 encrypted passwords in cookies for a "Remember Me" feature, I'd love to figure out a more secure way of doing this.

So the question is - is it possible to implement "Remember Me" in J2EE in a secure way?

Setting the cookies on a certain path (i.e. /roller/security/) works, but not on Tomcat 5. I want to securely set my userid/password/rememberMe cookies at the root level of my app, map a filter to login.jsp (dispatcher = forward for TC 5) and be done with it.

Posted in Java at Jan 14 2004, 10:27:04 AM MST 6 Comments

Inversion of Control - what the heck is it?

I really didn't know what Inversion of Control meant, until I started reading Rod Johnson's book. Today, on the spring-user mailing list, and article was posted about Inversion of Control. The article is by Martin Fowler and is titled Inversion of Control Containers and the Dependency Injection pattern. If you don't understand all this IoC stuff, or just want to learn why Spring and PicoContainer are the talk of the town, you should read this article.

On a side note, the guys at TheServerSide shouldn't feel bad about not setting their background color - Martin Fowler is no HTML genius either.

Posted in Java at Jan 14 2004, 09:59:06 AM MST 6 Comments

Macromedia's Flex

I learned about Macromedia's Flex from the JavaLobby Newsletter this morning.

In essence, Flex is a presentation server that sits on top of a standard Java servlet container like Tomcat and provides the ability to use the Flash player and an updated scripting language to manage the client-side user interface of a web application. The Flex Runtime Services provide management of server-side security, connections to data sources, and so forth. The Flex Class Library provides support for a full set of server-side flash components that can be accessed via an XML markup language currently called "MXML" (which is going to change before the product release.) MXML contains the tags for the widgets in the Flex Class Library and allows you to express rich user interfaces succinctly.

I've always liked Flash, but I'm also a sucker for eye candy and cool-looking UIs. If Macromedia could make it possible to create flash files with a markup scripting language, like I do HTML/JavaScript for JSPs - I think they'll get a winner. If we're forced to use IDEs and other tools to drag and drop components - I won't bite. I'm too used to typing vs. point and clicking. I don't use Dreamweaver for HTML - why would I start now?

However, I do have a friend who is an awesome Flash Animator - it'd be cool to hook up with him someday to create rich web UIs. Only problem is - I think it'll be tough to find a client that prefers a flash interface over an HTML-based interface.

What would be awesome is if I could use a RenderKit from JSF to create a Flash UI. The ability to write standard HTML/CSS and have it generate a Flash UI that could do everything like a desktop app - mmmmm, sounds sweeeeettt.

Update: The Flex JSP Tag Library might be just what I was looking for. I also found an article on Providing a Flex Front-End to your Struts Applications. In my opinion, the one reason that Flex won't work is that it will cost money - all other J2EE View technologies are free. Cheap is good though - it might work if it's a mere 50 bucks.

Posted in Java at Jan 14 2004, 07:08:09 AM MST 5 Comments

Good News from TheServerSide

I woke this morning and was doing my normal perusing of JavaBlogs and came across a couple of gems: Middlegen 2.0 VO was released and TheServerSide.com has a new UI. A couple of thoughts I had:

  • What the heck does VO stand for in the Middlegen Release message? Does this new release support Struts 1.1?
  • The new UI for TSS looks great, but did they intentionally not set a background color on the page (shows up gray on my screen)? I think they forgot to set a background-color, because the stylesheet doesn't have one defined. Do me a favor, if you're a web developer, change your default background color in your browser to something obnoxious (i.e. purple) so you don't make this same mistake. Granted, most browsers default to white, but this is a mistake that only rookies make.

Posted in Java at Jan 13 2004, 06:28:56 AM MST 6 Comments