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.

Prettying up JSPWiki's URLs

Recently, AppFuse user Charlse Li sent me an e-mail with a "PostfixURLConstructor" class designed to pretty up JSPWiki's URL. With the patch he sent, I was able to change URLs from /wiki/Wiki.jsp?page=AppFuse to /wiki/AppFuse.html. Applying the patch was quite easy, but maintaining backwards compatibility and security required a little more work. Below are the steps I went through to get everything working properly:

  • Download postfixurlconstructor.zip and extract to your hard-drive. Copy the "com" directory to your wiki/WEB-INF/classes directory.
  • Change the <url-pattern> of the WikiServlet in web.xml from /wiki/* to *.html.
  • Add the following two lines to your WEB-INF/jspwiki.properties file:

    jspwiki.urlConstructor = PostfixURLConstructor
    jspwiki.PostfixURLConstructor.postfix = .html

This is all you need to do to change the default URL schema. However, if you're like me and you've had a JSPWiki instance setup for awhile, you'll need to maintain backwards-compatibility. I wanted to make sure the old URLs mapped to the new ones. In addition, the "edit URL" changed from Edit.jsp?page=PageName to pageName.html?do=Edit. Since web.xml and <security-constraint> can't contain regular expressions, I used the ultra-cool UrlRewriteFilter to solve both issues. Here's the steps I went through to configure it properly:

  • Download UrlRewriteFilter 2.5.1 and extract the JAR to your WEB-INF/lib directory.
  • Change your web.xml to use a 2.3 DTD instead of a 2.2 DTD and add the filter and filter-mapping to web.xml.
  • Create a WEB-INF/urlrewrite.xml file with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<!DOCENGINE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.5//EN"
    "http://tuckey.org/res/dtds/urlrewrite2.5.dtd">

<urlrewrite>
    <rule>
        <from>^/Wiki.jsp\?page=(.*)$</from>
        <to type="redirect">$1.html</to>
    </rule>

    <rule>
        <from>^/(.*).html\?do=Edit$</from>
        <to type="redirect">Edit.jsp?page=$1</to>
    </rule>
</urlrewrite>

That's it - restart your server and you should be good to go. Thanks for the patch and instructions Charlse!

Update: There does seem to be a couple of issues. The 1st is that none of the attachments are resolving correctly (example). The 2nd that when I try to edit a page, it always shows up with the Main page's text. I'm not going to back out the change just yet, but I will if I can't fix it in the next several hours.

Update 2: I ended up backing out this change, but left in a forward from *.html to Wiki.jsp?page=$1 so all URLs in this post should still work. The "not being able to edit" was the major reason I rolled back to the old URL schema. The attachment issue seems to be related to my browser's cache. Clearing it fixed the problem.

Posted in Java at Aug 21 2005, 03:01:59 PM MDT 1 Comment

Wicket is the most widely used Java Web Framework

According to this post, Wicket is the most widely used Java web framework. While I believe his statements are true, IMO it's only true in the context of this guy's post. My guess is that most of the folks that read his post were Wicket users, or somehow the Wicket Team got wind of this and told users to e-mail this guy. The main reason I don't believe that Wicket is the most popular is because it's so new. I do think it's an up and coming framework that may become the most popular, but I don't think it's there yet.

So, to answer this question, I believe that claiming Wicket to be the most widely is Just Good Guerilla PR. To put some numbers behind that, here's some graphs showing mailing list traffic for the various Java web frameworks.

Web Framework Mailing List Traffic - May/July 2005

Granted, these are just indicators of the number of users - but I believe they are a good indicator. One interesting note about these stats is that Wicket's mailing list traffic has increased significantly in the past few months. Ironically, here's what one of the Wicket developers had to say about this statistic about a month ago:

... who says having a lists that has a lot of traffic is a good thing? It might just as well be an indication of a too-hard-to-understand framework having insufficient documention.

In the past couple of months, I've spoke in front of 25+ Java developers on 4 different occasions to talk about web frameworks. I've asked those developers which frameworks they've used, or plan on using. Struts is still the most widely used, with WebWork and Tapestry the least used. Surprisingly, JSF seemed to be getting no traction among the the audiences I spoke to. Even more surprising (to me at least) was that the most popular web framework continues to be the in-house framework. The overwhelming majority of the developers I've talked to aren't even using open-source web frameworks.

Posted in Java at Aug 18 2005, 12:13:11 PM MDT 2 Comments

Integrating Lucene with Hibernate

The code_poet has an interesting post on using a Hibernate interceptor to index objects for Lucene searching. I've been thinking about integrating Lucene into AppFuse (or at least providing a tutorial) for quite some time. Hopefully this post will serve as a starting point when I do. I wonder how much the Lucene code can be simplified by the Spring support in the Spring Modules project?

Posted in Java at Aug 17 2005, 10:19:09 PM MDT 17 Comments

Roller 2.0 looks good!

Dave has posted some screenshots of Roller 2.0. I have to say, the new UI is a big improvement, both with colors and fonts. I hope to try 2.0 out today and hopefully get it installed at Virtuas in the next week or two. I can't wait until this release is installed on JRoller - it'll be very cool when many people can participate in a SourceBeat blog. Nice work Dave!

FWIW, I plan on hanging out in #appfuse and #roller on irc.freenode.net this week. Stop by and say hi if you have questions about either project.

Posted in Roller at Aug 16 2005, 09:32:11 AM MDT Add a Comment

Equinox on Resin 3.0.14

Yesterday I moved demo.raibledesigns.com from Kattare to Contegix. The main reason I moved is because Contegix is much more responsive when I have issues, as well as Kattare's server was incredibly slow to startup Tomcat. The move went pretty smoothly, but I did run into a couple issues - caused by moving from Tomcat 5.0.28 to Resin 3.0.14. The issues were only in one application - the MyFaces version of Equinox.

The first issue was that the corejsf-validator.jar that I'm using (for client-side validation) contained an invalid TLD file. It was easy enough to fix as it was missing a <short-name> element. This is the 2nd issue I've found with this library - obtained from David Geary's Core JSF book. The first issue is that Spring's Ant-style patch matching doesn't work when this JAR is in the classpath. Anyone out there using a better (less buggy) library for client-side validation in JSF?

The 2nd issue was that MyFaces depends on commons-el.jar, which is shipped with Tomcat. Not so with Resin. Adding this JAR to my WEB-INF/lib directory solved the problem. I've committed both changes to CVS.

Below is a full listing of the sample apps I have installed on this server. The one app that I didn't move is Struts Resume. I'll be moving that one to appfuse.org today.

I'm open to adding more, so let me know if you have one you'd like hosted. Of course, I reserve the right to refuse suggestions based on my interest in the functionality they're demonstrating. ;-)

Posted in Java at Aug 16 2005, 08:50:27 AM MDT 4 Comments

Awesome weekend in Michigan

This weekend was a blast. I flew up to Grand Rapids, Michigan for a good friend's wedding on Friday. The wedding was near Ludington, which is right on Lake Michigan. It was a beautiful resort-town, where the water was warm, the sun shining and the beer ice cold.

It was a great trip, but after being stuck in Chicago's O'Hare airport last night - I hope I don't have to travel again for a while. At one point, the United flight to Denver had 143 people on the standby list! After a little Motel 6 4-hours-of-sleep action last night, I got on the 6:30 a.m. flight and made it back to Denver this morning.

Posted in General at Aug 15 2005, 02:39:56 PM MDT 5 Comments

First Magazine Article: Challenges in the J2EE Web Tier

It's official - I've written (and published) my first article in a magazine. If you received the July issue of Java Developer's Journal, you'll see my article titled Challenges in the J2EE Web Tier.

Over the course of its life, the J2EE Web Tier has faced many challenges in easing Web application development. While it's a scalable, enterprise-ready platform, it isn't exactly developer-friendly. Particular challenges to Web developers include the need for a standard Web framework, compatible expression languages, and availability of components. Several Web frameworks have been developed to resolve these issues, each with its own strengths and weaknesses. This article discusses the unique challenges of the J2EE Web Tier and how various technologies have attempted resolve them. By learning from and competing with each other, these Web technologies play an important role in pushing the limits of excellence to produce ever-higher standards of Web application development.

Enjoy!

Posted in Java at Aug 10 2005, 04:30:22 PM MDT 11 Comments

Failed upgrade to Struts 1.2.7

Yesterday I made an attempt to upgrade AppFuse to use Struts 1.2.7 instead of 1.2.4. Everything seemed to go smoothly until I started running my Canoo WebTests with JavaScript enabled. It turns out there's a major bug (IMO) in Struts 1.2.7 where the JavaScript rendered by Commons Validator can't handle the Struts' <form> tag in XHTML mode. I tried a nightly build (20050809), but it's not fixed there either, so I backed out the upgrade.

The interesting thing about Struts 1.2.7 is SpikeSource has certified this release. Are they not testing JavaScript as part of their certification test?

Another thing I attempted to upgrade yesterday was Canoo WebTest from build574 to build976. No dice - mainly because of issues with Prototype (I think). The worst part is everything works fine in a browser. Even worse is I still have a problem with build574, but it doesn't cause the tests to fail. Times like this make me wish Selenium was more polished and ready to use. I talked with some ThoughtWorkers last week and they said the Java driver is ready for a 1.0 release, but one of the committers wanted to make sure all language drivers were ready first (at least that's what I remember).

Posted in Java at Aug 10 2005, 11:17:35 AM MDT 9 Comments

Shifting Priorities

Daddy's Bus in Zion This week's Denver JUG meeting looks to another good one - this time Bruce Tate is presenting Beyond Java and Sharad Acharya will talk about dynamic Struts Forms. I'm sure I could learn a thing or two from attending this meeting, but I'm going to have to pass.

It's time for me to shift my priorities. The 2nd week of every month, there are two meetings I'd like to attend - but I've only ever attend one (DJUG). I don't attend both b/c they're back-to-back and that's not very nice for me to leave Julie to fend for herself with the little munchkins. Starting tomorrow, I'm going to quit going to DJUG and start going to the Colorado VW Bus Club meetings instead.

It's time to start restoring the bus. I started it up this weekend and it roared to life after sitting for several months. I took it for a spin around the block and I can feel that it's ready. I am too. ;-)

Posted in General at Aug 08 2005, 09:57:52 PM MDT 1 Comment

Things I learned from OSCON

While at OSCON last week, I learned quite a few things. Many of these are my own opinions, so feel free to disagree with them.

Ruby is very cool

The main reason (for me) that Ruby is cool is because it's new. I don't have to know any of its history to know what makes it tick. It's easy to learn and has powerful language features that make it easy to use. I think the primary reason people, particularly Java developers, are excited about it is because it releases them from all the shackles they're accustomed to with Java. I have absolutely no plan to ditching Java and jumping to Ruby, but I do want to learn it so I can use it when it's a better fit than Java.

How to learn Ruby and retain that knowledge is the hard part. My current plan is to buy Programming Ruby and Agile Development with Rails. Unfortunately, I realize that I probably won't be able to finish these b/c I'll get bored and both will likely serve as more of a reference than a knowledge creator. I haven't been able to read a technology book cover-to-cover in several years. I couldn't even finish The Pragmatic Programmer for crying out loud. I realize that the best way to learn is to do, but the best way to do is to get paid to do. To facilitate this, I hope to develop some apps we can use at Virtuas. Of course, I'll try to find good open-source solutions first.

Rails has a lot of great ideas

The interesting thing about Rails is many of its good ideas are from Ruby. The built-in Webbrick web server is part of the language. The only way to come close in the Java world is to embed Jetty or something like that. I'll definitely be looking into embedding Jetty into AppFuse in the near future. The other thing I really like about Rails, and that I've been doing in AppFuse a bit is convention over configuration. As part of AppFuse, I'm already making a lot of decisions for users. The next step seems to be making all decisions for users, but allow them to override. It'd be cool to write some code that sweeps through all classes at startup and auto-configures them, w/o the need for any XML. If nothing else, the XML could be generated using reflection.

The biggest thing I learned from Rails is I need to provide 1) an easier upgrade path and 2) better Ajax support. Because I'm supporting so many different web frameworks, solving #2 might be a bit tricky - but could be done by writing tag libraries or components. Hopefully the framework developers will beat me to it and I won't have to do anything. As far as #1, I'm hoping I can move to a single appfuse.jar that contains all the base classes. Hopefully I can use a little JSP pre-compile action to re-use the existing JSPs for user management/etc. If not, I can always use something like FreeMarker to store the default view files in a JAR.

Creating Passionate Users is all about inspiring emotion

Kathy Sierra's talk about inspiring emotions among your users to make them transparently excited about your product/company was a real eye-opener. I can totally see what she's talking about and I'm happy to say I'm already doing some of it. This blog seems to attract lots of readers, some more passionate than others, just by talking about web technologies and Java. This does translate into more business for Raible Designs, whether it's the title image or URL, it doesn't really matter. Folks do figure out that I have a company and I do work with the technologies I talk about.

To apply these concepts to AppFuse and Virtuas is a little more difficult. For AppFuse, I can probably teach people how to better use Hibernate, Spring and Ajax - and then show how AppFuse can simplify things. Building in easy-to-use Ajax support is probably essential to really get this going. For Virtuas, we could re-vamp our site to provide education about open source and its history - providing users with a way to become open source experts. It would also be cool to do real-time reporting of how we helped a company adopt open-source.

Ideas, ideas, I have lots of ideas after last week.

Posted in Java at Aug 08 2005, 03:40:38 PM MDT 4 Comments