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.

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

Sunken/Highlighted Input Fields with CSS

One thing I really like about TheServerSide's new look is the sunken input boxes (that light up on focus) in the top right corner. I noticed that Macromedia does this on a lot of their form's too. It's good stuff. Here's how easy it is to add this "feature".

In your stylesheet, add the following class definitions:

/* for cool looking "sunken" input boxes, from www.theserverside.com */
form#searchForm input {
    padding-left: 4px;
    margin: 1px 1px 1px 1px;
    border: 1px solid black;
    color: #777;
    background-image: url(../images/input_white.gif);
}

form#searchForm input.focus {
    margin: 0px 0px 0px 0px;
    border-bottom: #ffdead solid 2px;
    border-right: #ffdead solid 2px;
    border-left: #c07300 solid 2px;
    border-top:  #c07300 solid 2px;
    color: #000000;
}

Of course, restricting these classes to one form (as I've done with form id="searchForm") is optional. Then in your form's input fields, add: add a couple of onfocus and onblur event handlers:

onfocus="this.className='focus'" onblur="this.className=''"

You'll also need to grab the background image and put it on your site. If you're adding this to a form in your webapp, it might be easier to add all the event handlers with JavaScript:

var inputs = document.getElementsByTagName("input");
for (i=0; i < inputs.length; i++) {
    inputs[i].onfocus=function() {this.className='focus'};
    inputs[i].onblur=function() {this.className=''};
}

Thanks to the guys at TheServerSide for showing me how to do this - I dig it.

Posted in The Web at Jan 14 2004, 08:35:50 AM MST 11 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

[New Feature] Wiki Syntax support added to comments

For you, my friends, I've added the ability to use JSPWiki syntax when writing comments. All you need to do is start your comment with an exclamation point - ! Hopefully this will help add automatic line-breaks when you add a line-break in the textarea, as well as making it easier for you to you to type in any code. If you're typing or pasting in Java code, try using the Java2HtmlPlugin. It's easy to use, just type the starting and closing tags, and insert a blank line before your code. For example, here's the raw text.

[{Java2HtmlPlugin 

public class HelloWorld {  
  public static void main(String args[]) {
    System.out.println("Hello World!");
  }
}
}]

I don't know if the "Preview" button (from the Permalink) supports it, but I've added the following to both twisty comments and regular comments.

        #if($content.startsWith("!"))
            #set( $wikiText = $stringUtils.substring($content,1))
            #set( $renderedText = $wikiPlugin.render($wikiText))
        #else
            #set( $renderedText = $content )  
        #end
            $renderedText

Enjoy!

Posted in Roller at Jan 13 2004, 05:48:44 PM MST 3 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