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.

Tomcat 4.1.17 Alpha

Apache Tomcat 4.1.17 Alpha has just been released. Significant changes over 4.1.16 Beta include fixing socket binding in Coyote JK 2 (where only the loopback interface would be bound), administration webapp fixes for resource link handling, minor performance tweaks in the TCP endpoint, as well as other minor fixes. View the release notes or download.

Posted in General at Dec 12 2002, 12:23:20 AM MST Add a Comment

Design Patterns, Marc Fleury and JBoss

I just got back from the Denver JUG meeting and have lots to talk about. I've started this post at 11:03 p.m., for the record. I want to start out with discusssing a topic that Dave and I talked about a few days ago. Basically, in his Ag application, he is using one Business Delegate and one DAO to do all his business logic and data access. Actually, he's got two DAO's, one for Hibernate and one for Castor. Basically, the DAO is determined at startup, set on the Business Delegate and then stuffed into the servlet context. While Ag is a small application, it got me thinking. I believe the recommended pattern for this is to have a Business Delegate for each entity, as well as a DAO. So for a user, you would end up with 4 classes, UserManager/UserManagerImpl and UserDAO/UserDAOHibernate. So everytime I add a new entity, i.e. account, I have to create 4 new classes. What a pain, and a lot of copy and pasting - or at least that's how I'd do it.

Dave's KISS methodology at first struck me as strange, but then I thought, "Damn, that's a lot easier." So now in AppFuse (reference implementation: security-example), I changed to use this idea - with a BusinessManager/BusinessManagerImpl and ApplicationDAO/ApplicationDAOImpl. The idea is that these will contain any and all methods to access data.

I went to the DJUG meeting still struggling this this pattern, feeling like it stunk and I should back it out and go with a factory pattern and a business delegate/dao for each entity. However, during Marc Fleury's presentation, he preached that one of the founding rules of JBoss was KISS. He said that the greatest thing about open source is that no one will ever even look at your code until it's broken. "And how bad does it suck when you have to look through 5 levels of inheritence to figure out the problem?" He mentioned that bad code was his favorite, because chances are - if there's a bug - it'll be staring you in the face, rather than buried inside some design patterns and 10 different classes. I agree, so I'm going with KISS, but I'm also interested in hearing your opinions. I like the current architecture of AppFuse because it sets the business manager on startup, stores it in the servlet context and is available for everyone to use at any time. There's nothing saying that I couldn't set a SessionBean (on the business manager as it's proxy) and call EJBs for my persistence layer.

In fact, after Marc's gospel about JBoss, I want to use EJBs. In fact, not just EJBs, I want to use JBoss - and I can't wait for "JB 4." Why? Well they're adding the ability to add all of EJB's services (i.e. Security, Transactions, Persistence) to any POJO. This means that all you need to do is write a little deployment descriptor for it, and whalla, you're in business. His sermon is something you really need to see to appreciate. I can't do it justice in summarizing it here, but I certainly liked what he had to say, and feel like I'm a better person for it. The JBoss Group's goal is to become the de facto standard for application servers. I like their idea that the app server should be free - and the money (usually spent on app servers) should be directed towards smart developers instead. He also mentioned that JBoss Group (the company) is doing great right now and will be spending some cash on Marketing and PR to squash any rumors that it's not good enough.

Marc mentioned that most of the things he talked about tonight are written in his Blue Paper (PDF, 11 pages), titled "Why I love EJBs". It's part 1 of 3, the Blue of the "Red, White and Blue Technology Trilogy."

Other news that I stumbled upon today:

  • JBoss uses JavaGroups, and I've heard you can make work with Tomcat - for clustering and such.
  • The release plan for Struts 1.1 Beta 3 has been committed to CVS, code freeze this Saturday.
  • Ted Husted defends Struts after I posted it's recent criticizm to the mailing list.
  • The xPetstore Application has a new release. xPetStore is a refactored version of Sun PetStore application that shows how to use xDoclet to build WODRA (Write Once, Deploy and Run Anywhere) J2EE application. Tested with JBoss and WebLogic.

Phew, done at 11:44 p.m.

Posted in Java at Dec 11 2002, 05:37:32 PM MST 4 Comments

Deadlines and Opportunities

I turned in my 1st draft of the Security Chapter on Monday and I'm sending my example app to go along with it as we speak. That means I'm 3 days late on my first deadline - doh! And my second deadline is Sunday - for the Struts Chapter - fat chance of hitting that one. To make matters more convoluted, I have had more calls this week about new opportunities than all year!! As you might now, I don't have a full time gig right now - so opportunities are most important right (especially with a little one and wife to support). So I will be staying up until the wee hours of the morning, acting like a keyboard monkey, until sometime next week. I can't wait to get this over with. The writing part is cool - but I can't concentrate on writing - I get too caught up in the sample app and waste hours trying to tweak stuff. Damn, I can't wait to get rid of this stress.

Posted in General at Dec 11 2002, 09:39:04 AM MST Add a Comment

The TVC Framework

Here's an interesting new extension for Struts:

The TVC Framework uses the Struts framework to create HTML tables with functionality that includes paging, sorting, filtering of data, and data validation.

This joins the ranks of Ed's <display:*> tag library and Yuriy's html table tag library. I've always like the display tag library as it's easy to setup and use - just pass it an ArrayList of beans and you're off! The TVC Framework seems to offer some cool functionality, but you have to pay $995 for the good stuff :(. Of course, if you're trying to code similar functionality on your own, you'd probably save your self some money if you bought it.

Posted in Java at Dec 11 2002, 04:20:36 AM MST 3 Comments

Matt on Google

Matt Croydon (yeah, I can't spell your last name either ;-) is the 45th Matt on Google. I'm at #213, hopefully all the Matt's in this post will boost my rankings. BTW, did you know you can adjust your preferences in Google to show more than just 10 records per page? Kinda handy for silly searches like this.

Posted in The Web at Dec 10 2002, 05:41:51 PM MST Add a Comment

IDEA vs. Eclipse

I've been switching back and forth between IDEA and Eclipse for the past couple nights. I DO like IDEA, but as I only have 3 days left on my evaluation, I'll sadly have to let it go. My favorite feature is it's ability to recognize that you haven't imported a class, and then allows you to hit Alt+Enter to add the import. Also, it grays out imports that aren't being used, both very slick features. As for generating getters and setters, it does a poor job in my opinion. It puts them above your variable declaration and doesn't add any javadoc comments. Eclipse puts them at the bottom of your class and adds javadoc comments - so Eclipse wins here. Also, Eclipse does a much better job of adding and recognizing javadoc comments. IDEA wins on indentation, it always seems to know where you want to be. If I get a full time gig here soon, I might have to buy IDEA. I think it's best when you can use multiple tools to make your development life easier. I say screw these debates on Eclipse vs. IDEA or Struts vs. Webwork - use them all! (I need to examine Webwork as it gets lots of good comments from it's developers.) Of course, it's easier to use both when you have a dual-monitor setup! I highly recommend this... it's awesome!

Later: The other thing that IDEA wins on is that it can actually run my Ant script without puking. Eclipse doesn't let me run it - maybe it's cause it has Ant 1.4.1. Hmmm, wonder if I can upgrade it to 1.5.1. IDEA has better XML editing, and even seems to detect errors in build.xml.

As I'm editing this post with the Later paragraph, I received the following from Cédric (who seems to work for BEA from his e-mail address).

You didn't say if you already knew this about Eclipse, so I thought I would tell you anyway:

- To fix a missing import, just press Ctrl-1 (Quick Fix) on the class with squiggly lines. Ctrl-1 does a lot of incredible things, like it sometimes reads your mind. I much prefer this approach to having specific actions and shortcuts to remember. Another interesting one is Ctrl-Shift-O (Organize Imports), when you have a lot of imports to fix. Eclipse will analyze your whole source and add them all for you (and possibly prompt your when there are ambiguities).

- The latest builds underline the unused imports with yellow squiggly lines.

-- Cédric http://beust.com/weblog

Sweet! Must be time to download a nightly build!

Posted in General at Dec 10 2002, 10:35:41 AM MST 4 Comments

Forcing SSL on a JSP

I'm trying to replicate the behavior that occurs when you set CONFIDENTIAL to confidential in web.xml. If I do this, when I hit the index.jsp page of my webapp, I am automatically redirected to https://localhost/myappname. However, I have a different SSL port setup for testing, and I'd like to only switch on one page, the index.jsp page. So I've added the following scriplet to my index.jsp and it works great in Mozilla, but fails in IE. IE prompts me with the certificate information, and then gives a "Cannot Find Server" error. Any ideas?

<%
// TODO: Make this into a tag library
Boolean secureLogin = (Boolean)application.getAttribute(Constants.SECURE_LOGIN);
System.out.println("secureLogin: " + secureLogin);
if (secureLogin.booleanValue()) {
    // make sure we're using https
    if (request.getScheme().equals("http")) {
        String redirectString = SslUtil.getRedirectString(request,
                                                          application,
                                                          true);
        
        System.out.println("redirecting to: " + response.encodeRedirectURL(redirectString)); 
        %>
        <logic:redirect href="<%=response.encodeRedirectURL(redirectString)%>"/>                                                    
        <%
    }
}
%>

Everything looks the same in Tomcat's log when using either browser.

Posted in Java at Dec 10 2002, 10:10:25 AM MST Add a Comment

XML Encryption/Decryption

Erik gives us the heads up on a new W3C Proposal: an XML Encryption, Decription Standards. Just after I finished my first draft of my chapter on Security!! Arghh! Oh well, I'm sure there will be a 2nd and 3rd draft. I'll have to read this article and see if it's relevant. The first draft was due Sunday, I turned it in yesterday. It is supposed to include a sample application, and I'm still working on it.

I was up until 5 a.m. this morning working on it. I got Hibernate working nicely, and I can generate my Hibernate persistence layer and my Struts (validator) forms using xdoclet. Cool stuff, I did have to write the business tier to talk to hibernate, and I did have to write a Hibernate class (DAO) to talk to the persistence layer. Not as easy and clean as I'd hoped for, but now that the groundwork is laid, it'll probably be easier to move forward. It's pretty sweet that I can add a getter/setter to my POJO (actually it's an entity bean since that's the only way to generate struts forms using xdoclet) and I get a new column in the database and in both my VO (hibernate uses this) and my Form.

Posted in Java at Dec 10 2002, 09:14:51 AM MST Add a Comment

Caching for Struts

An interesting new extension came through the struts-dev mailing list today. It's called the "neteye actioncache" and is an extension that provides a simple but powerful caching facility for struts. It's features as are:

  • Caching of binary and character data
  • Support for URL based session tracking
  • Allows to use multiple actions on a single page
  • LRU caching policy
  • Persistence

Pretty cool - don't know if I'll ever need it, but nice to know it exists. More information can be found at http://actioncache.neteye.de.

Posted in Java at Dec 10 2002, 08:40:04 AM MST Add a Comment

Postcard from Hawaii

My Mom and Dad are having a rough week - we received the postcard below from them today. My sister, Kalin, and I surprised them with a trip to Hawaii for their 30th wedding anniversary (November 16th). They never had a honeymoon when they originally got married, so we figured they'd enjoy one now! My dad was stationed at Waikiki beach when he was in the Navy - so he's having a lot of fun re-living old memories. I used Kurt's sharpen, resize, sharpen again technique on the scanned postcard below - seems to have worked pretty well. My gung-ho mom writes that she went running at 5:30 in the morning and there were a lot of folks already up and about. Running!? At 5:30 in the morning?! Yeah, she runs marathons too! She hadn't exercised in her life, in the traditional sense - we always got plenty of exercise living at the cabin - until my sister and I moved out. Now she's over 50 and in the best shape of her life! Go Mom - you're awesome.

Postcard from Hawaii

Posted in General at Dec 09 2002, 11:01:23 AM MST Add a Comment