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.

Struts Menu 2.0 Released!

This release is a significant refactoring of the 1.x codebase. The source and site is now built using Maven. Menus can now be defined using Velocity templates and support has been added for looking up dynamic values. This means that if you have ${variableName} in your menu-config.xml (in a link), the tag library will look in all scopes for a variable with the name "variableName". The example app has been updated to improve documentation.

IMO, the Velocity templates is huge because it means "if it's possible with HTML" - it's possible with Struts Menu.

Changes (from http://struts-menu.sourceforge.net/changes-report.html):

- Renamed package structure to net.sf.navigator.
- Added support for using Struts' actions and forwards for links in menu-config.xml.
- Added support for using dynamic variables in menu-config.xml.
- Updated build process to use Maven for building/deploying.
- Refactored to use Velocity and allow dynamic variable substitution.

You can read the nitty-gritty details about the Velocity enhancements, check out the sample app or download this tag library for yourself.

Posted in Java at Dec 01 2003, 04:03:09 AM MST Add a Comment

AppFuse 1.0 Released!

I feel this release deserves the big 1.0 designation because it is an up-to-date representation of my learnings and my perceived best practices in building web applications. Of course, as I learn more, I will continue to push out new releases.

In this release, I did a lot of refactoring and enhancements to existing features. The DAO and Manager interfaces are no longer tied to Struts or Hibernate. Hibernate's Session object is now passed as an argument into Manager and DAO constructors, rather than method signatures. The DAOFactory was refactored by Bear Giles to use reflection to instantiate Hibernate DAO's. Now, if you add a new DAO, you don't have to edit DAOFactory and DAOFactoryHibernate. To insantiate a new DAO, the code is now:

LookupDAO dao = (LookupDAO) DAOFactory.getInstance(conn, LookupDAO.class);

...where conn is a connection object retrieved from ServiceLocator or ActionFilter. When you add new POJOs, you still have to add them to ServiceLocator (for JUnit tests) and hibernate.cfg.xml, which is kindof a pain. I'd like to figure out a way to tell Hibernate to just look in appfuse-ejb.jar.

<tangent>
I still don't have a Factory for Managers, and I don't know that there's a need for one, but it's something I might add in the future. Managers are still creating using: LookupManager mgr = new LookupManagerImpl(ActionFilter.getConnection());. One thing I've been thinking about is the ability to switch webapp frameworks - kindof like you can do with Persistence Frameworks and the DAO Pattern. It'd be cool to add a way to switch (at build time) to use WebWork or Tapestry. Maybe by replacing values for the controller in web.xml. It'd probably be a pain since I'd probably have to create new JSPs for the new frameworks - but it would probably be a great learning experience.
</tangent>

The Remember Me feature has been refactored so the username and password cookies are only available under the /appfuse/security url-pattern. I also changed the posting to "j_security_check" in LoginServlet from response.sendRedirect to an HTTP POST, using Jakarta Common's HttpClient. The reason I have a LoginServlet vs. just using action="j_security_check" in my <form> is to encrypt passwords.

I've developed 3 different applications using AppFuse (struts-resume is one of them), and I have found that it's a pain to upgrade to new versions of AppFuse. Because of this, I don't recommend upgrading unless you really need to. I will be upgrading struts-resume to AppFuse 1.0, but I doubt I'll upgrade it to any future AppFuse releases - it's just too much work for not much reward.

Posted in Java at Nov 30 2003, 06:35:24 PM MST Add a Comment

JSTL Tips o' the Day

Here's a couple of tips to help you in your JSP development with JSTL:

  • The <c:out> tag has a default attribute you can use to provide a default value when the value in your the variable you're trying to write is null. This is much easier than using if statements. Example: <c:out value="${user.firstName}" default="None Given" />.
  • You can populate dynamic values in a key from your ResourceBundle using the <fmt:param> tag. For instance, if you have a message with a link in ApplicationResources.properties - and you want to populate it with a struts-forward, it's easy with JSTL:

    ApplicationResources.properties:

    mainMenu.link=Click <a href="{0}">here</a> to return to the Main Menu.
    
    In your JSP:

    <fmt:message key="mainMenu.link">
      <fmt:param><html:rewrite forward="mainMenu"/></fmt:param>
    </fmt:message>
    

Usually I try not to put any HTML in ApplicationResources.properties, but I don't think a minimal amount hurts anything. Of course, you could put all the HTML in your JSP, so mainMenu.link changes to "Click {0} to return to the Main Menu." and your JSP changes to:

<fmt:message key="mainMenu.link">
  <fmt:param>
      <html:link forward="mainMenu">here</html:link>
  </fmt:param>
</fmt:message>

Enjoy!

Posted in Java at Nov 30 2003, 06:14:20 PM MST 1 Comment

Archives now available

I finally got enough motivation to spend 5 minutes and make my archive page presentable. Enjoy! View source for the CSS. Most of the work on this page is accomplished with a macro in Roller: #showBigWeblogCalendar().

Posted in Roller at Nov 29 2003, 08:10:47 PM MST 3 Comments

Memory and Disk Space is Cheap

Memory and Disk Space sure is cheap these days. I got 1 GB of RAM for $150 last week, and I bought a 160 GB Hard Drive today for $80. Gotta love that!

Posted in General at Nov 29 2003, 11:38:43 AM MST Add a Comment

Happy Thanksgiving Y'all

Happy Thankgiving!

Happy Thanksgiving to everyone! This year I'm thankful for continued employment, a thriving Java community and an awesome family. Abbie and Julie are the most incredible women I've ever met. My parents, sister, and in-laws deserve a "Thank You" as well - you all rock. Here's a smile from Abbie to brighten your Turkey Day. Happy Turkey Day!

Abbie on a bench

Posted in General at Nov 27 2003, 05:10:38 AM MST

AppFuse won't work with J2EE 1.4 Final

I don't know why, but AppFuse's MailUtilTest won't run with J2EE 1.4 Final. It works fine with 1.4 Beta 2.

Posted in Java at Nov 26 2003, 10:09:12 PM MST Add a Comment

Upgraded to Roller 0.9.9

I upgraded this site to Roller 0.9.9-dev about an hour ago. Seems to be humming along quite nicely - and the GZip Filter is back in action (wasn't working before I upgraded). There looks to be a few issues to iron out still, but since I was able to figure them all out - I'm pretty darn happy with this release.

  • oscache.properties is missing from CVS
  • a bunch of the editors had leftover (?) taglib declarations - I replaced them with an include to /theme/taglibs.jsp
  • the value in Website > Config > Site Name shows up where "Home" used to - I had to rename my site to "Home" to maintain my same menu selections
  • there's a lot of SQL (or HQL) logging going on that I can't turn off
  • bookmark display macros are broken - you'll need to change the name of your bookmark names (in the macros) to have a /root/ prefix. For example, #showBookmarks("Articles" true true) -> #showBookmarks("/root/Articles" true true)

Hope this helps any early adopters...

Posted in Roller at Nov 26 2003, 10:06:00 PM MST 6 Comments

My Favorite Eclipse Plugins (Download v1.0)

When I go to new clients, I either have to install Eclipse, or help others configure Eclipse with cool plugins. So I made my own download of my favorite Eclipse plugins. If you want it, download version 1.0 from SourceForge. It includes the following:

Installation: Unzip to where ever you have Eclipse installed. I use c:\Tools\eclipse on Windows.

I don't really use XMLBuddy because it doesn't allow spaces (only tabs), but I suppose it's better than nothing. The built-in Ant Editor has the same behavior (tabs only). I'd love to find a plugin that gives code-completion for XDoclet when typing JavaDocs, but I couldn't find one. Sure, there's JBoss-IDE (which is just a bunch of Eclipse plugins), but that only has jboss-specific tags - no @hibernate, no @struts.

NOTE: Many of these plugins didn't work on Eclipse 3.0 M5, so I reverted back to M4.

OS X Users: Jalopy and Colorer don't seem to work at all for me (M4). You'll need to change Easy Explorer from "explorer.exe {0}" to "open {0}" in Window > Preferences > Easy Explorer.

These are all the latest versions as of November 26, 2003.

Posted in Java at Nov 26 2003, 01:02:59 PM MST 13 Comments

Unix Utils for Windows

If you develop on Windows, and you use Microsoft's "cmd" to run Ant or compile your classes - you really should install Cygwin - it's much easier and provides the same functionality as cmd. Even better, Dan sent me an e-mail (can't find it now) about UnxUtils - Native Win32 ports of some GNU Utilities. You can even download an executable to install it. I dig it - symlinks that actually work on Windows.

Posted in General at Nov 26 2003, 07:02:20 AM MST 3 Comments