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

You can also try this same search on Google.

Free hibernate.org!

The Hibernate team is looking for $1888 to buy hibernate.org from a commercial domain hoster.

The goal of this action is not to get us rich (and others poor ;), but only to buy the domain. To give you an impression on how much money is needed: Hibernate is downloaded 500 times every day. The Hibernate website has more than 15.000 pageviews and 1.500 visits each day. If we estimate that every 10th person downloading Hibernate donates a dollar, we can free this domain in a little more than one month!

I'll probably donate. While we're at it, is anyone willing to help us Roller developers buy roller.com for $15,000? ;-) This is down from $20,000 when I originally inquired. No word on how much for roller.org.

Posted in Java at Jun 24 2003, 11:24:00 AM MDT 1 Comment

RE: Using Struts' Declared Exceptions

I modified the ActionExceptionHandler I reported on earlier. Now it uses the already built-in functionality of the Struts' ExceptionHandler and also only reports messages that are distinct. That is, it checks the next exception's message to see if the current message is a duplicate. Probably best to let the code speak for itself.

I'm not expecting anyone to care - I just want to make sure the code I'm using is accurately reflected here (rather than the initial, untested prototype).

Posted in Java at Jun 23 2003, 10:23:01 AM MDT 1 Comment

[ANNOUNCE] Tomcat 5.0.3 Alpha released

From the tomcat-user mailing list:

Tomcat 5.0.3 Alpha is now available for testing.

Please refer to the changelog included in the release for the list of changes. [Download]

I've found that this release is not worth your time. It's even worse than 5.0.2. For details, check out my Tomcat 5 upgrade page.

Posted in Java at Jun 23 2003, 07:13:56 AM MDT Add a Comment

[OS X] Java 1.4.1 Update DP102

While looking for a webcast for Apple's Worldwide Developers Conference, I found that a new version of JDK 1.4 was released yesterday. I doubt I'll install it - especially since I'll have to reinstall OS X to cleanly remove the build. Also, the part about "don't install this on a system with critical data" is a little discouraging - especially when I haven't experienced any bugs in the current JDK 1.4 build I'm running.

Summary: This seed consolidates a number of recent bug fixes to Java 1.4.1 and includes the changes to Java 1.3.1 from the recent Java Oracle bug fix release. The purpose of this seed is to expose the Java 1.4.1 changes to a broad sample of real-world code. While DP101 has undergone only limited testing, it is based on Apple's latest internal builds of Java, which are tested continously.

Warnings: This build has received limited testing and comes with no support. Do not install this on a system with critical data. This build installs over both Java 1.3.1 and Java 1.4.1; you will need to reinstall Mac OS X to cleanly remove this build and revert to an earlier versions of Java. This build is for evaluation purposes only, to determine if critical bugs have been addressed. You cannot distribute this build in any way.

Posted in Java at Jun 22 2003, 09:32:22 PM MDT Add a Comment

No Fluff, Just Stuff

In the interest of no fluff, just stuff, I've altered my theme. The old theme was 162.7 KB for this entire frontpage (in Mozilla: File -> Save Page As...), while the new one is 101.8. So I've reduced it quite a bit, considering that there's around 50K of pictures from posts and such. Thanks to all who suggested reducing the page size. I don't know how long I'll keep this theme intact, at least until the end of the month probably - in hopes of saving some bandwidth. I hope you like it, and if you don't - let me know why - and then help me improve it.

  • IE ignores the "max-width" CSS property, so you might get a width over 1024px for the body - causing the heading background image to look funny.

I'll add to this list as feedback rolls in. If you'd like to add to the list of available stylesheets for this theme, send me an image (1024 x 150) and I'll add it. Here's a simple stylesheet that you can alter to override settings in the basic one (simple.css). This theme has the stylesheet switcher integrated, so it's easy to change to a different stylesheet.

Posted in Java at Jun 22 2003, 11:51:22 AM MDT 12 Comments

.NET's built-in tools and controls generate invalid XHTML and CSS

Mails we've received, forum discussions, and recent Splorp posts all complain that .NET's built-in tools and controls generate invalid XHTML and CSS. The workaround? Don't use the built-in tools and controls. The value of .NET without those built-in tools and controls? Not much.

.NET is Microsoft's platform for web services. It derives it power from XML, a web standard. A product based on one open standard should support others, not break them.

When Microsoft does the wrong thing, developers feel helpless. You are not helpless. You have a choice of development platforms. [Zeldman]

(emphasis mine) The choice is simple, use J2EE ~ where the flexibility is free! wink

Posted in Java at Jun 20 2003, 01:14:42 PM MDT 3 Comments

Professional JSP 2.0 Update

Just in case anyone is interested, I thought I'd report on how Professional JSP 2.0 (now being published by Apress) is progressing. I received some initial feedback that my Struts/XDoclet chapter would not be included in the book, but would be a separate download (I'd still get paid for it though). Most of the reasons seemed to be indicating that the chapter was too advanced - newbies wouldn't get it. Personally, I hate reading newbie books, so why would I write a newbie chapter? I also hate simple sample apps, that's why I wrote a fully functional one. Anyway, I convinced them that this chapter did have value and now they are going to include it in the book, but as a case study rather than a regular chapter.

As for the security chapter, they said they really liked the content, but (again) the example was too advanced. I have been asked to remove XDoclet as a dependency since I don't explain it until the Struts chapter. This turned out to be a lot easier than I thought it'd be - only took me about an hour last night. I simply built the project with XDoclet, and then copied the artifacts (web.xml, generated ValidatorForms, struts-config.xml, validation.xml, *.hbm.xml, etc.) back into the source tree. I then tweaked the build.xml file to pick up the artifacts, ran "test-all" and voila - it worked?!

The lesson I learned from all this is that XDoclet is great for rapid development - but possibly only while you you are developing new features. Once an application stabilizes or development is discontinued (I don't plan on further developing security-example), it's pretty easy to strip out the XDoclet dependency and (probably) make it easier for users to understand.

Posted in Java at Jun 20 2003, 10:40:55 AM MDT 11 Comments

Quit Reading Me!

Just kidding. It's just that the ol' bandwidth issue has reared its ugly head again. I sent the following message to Keith last night:

Am I reading this stats page correctly?

Am I already over my KB limit for the month?

His response:

Wow, you've almost 3/4 million hits already this month....

It looks like it averages about 7.7K per hit, so yep, you appear to be over 5 
GB already this month.

I only have a 5 GB plan, so I asked him how much it would be to move to a 10 GB plan (no response yet). Why don't I just move? Because I like Keith, and ever since I moved to the new server, stability has been awesome. I pay $30/month for the 5 giger, so hopefully I can get the 10 GB for an extra $10/month. Then again, according to this page, 8 GB is $80/month. Maybe I will be moving...

Posted in Java at Jun 20 2003, 06:23:31 AM MDT 11 Comments

Using Struts' Declared Exceptions

With a little prodding from Erik Hatcher today, I took another look at Struts' Declared Exceptions feature. At the end of last year, I was wishing I could use declared exceptions to do chained exceptions for my Action classes. Basically, in each of my Actions, I have a try/catch wrapped around a call to the Business Delegate (example: UserAction.java). You'll notice that all the CRUD methods have the same catch block for exception handling:

} catch (Exception e) {
    e.printStackTrace();
    errors.add(ActionErrors.GLOBAL_ERROR,
               new ActionError("errors.general"));

    while (e != null) {
        errors.add(ActionErrors.GLOBAL_ERROR,
                   new ActionError("errors.detail", e.getMessage()));
        e = (Exception) e.getCause();
    }

    saveErrors(request, errors);

    return mapping.getInputForward();
}

After talking with Erik this morning, I decided to create an ActionExceptionHandler for java.lang.Exception. In my struts-config.xml, I added:

<exception type="java.lang.Exception" key="errors.general"
    handler="org.appfuse.webapp.action.ActionExceptionHandler"/>

I have "errors.general=The process did not complete. Details should follow." Here is the code for ActionExceptionHandler:

public final class ActionExceptionHandler extends ExceptionHandler {

    public ActionForward execute(Exception ex, ExceptionConfig ae,
                                 ActionMapping mapping,
                                 ActionForm formInstance,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
      throws ServletException {
        ActionForward forward = null;
        ActionError error = null;
        ActionErrors errors = new ActionErrors();
        String property = null;

        // Build the forward from the exception mapping if it exists
        // or from the form input
        if (ae.getPath() != null) {
            forward = new ActionForward(ae.getPath());
        } else {
            forward = mapping.getInputForward();
        }

        ex.printStackTrace();
        errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.getKey()));

        while (ex != null) {
            errors.add(ActionErrors.GLOBAL_ERROR,
                       new ActionError("errors.detail", ex.getMessage()));
            ex = (Exception) ex.getCause();
        }

        // Store the errors and exception
        request.setAttribute(Globals.ERROR_KEY, errors);

        return forward;
    }
}

This allows me to remove my generic try/catches from my action classes - very slick IMO (or at least better than the code smell I had)! Of course, I still have some catch blocks that catch specific exceptions, but I can either (1) leave those intact, or (2) create another declared exception for that particular action/exception. I dig it and will be adding it (in short order) to AppFuse.

Update (June 23, 2003): Here's a more thoroughly tested code sample of this same class.

Posted in Java at Jun 19 2003, 05:55:20 PM MDT 3 Comments

Sending POJOs to the UI instead of ActionForms

I'm starting to think that my Struts-based apps could be simplified if I didn't convert POJOs to Action Forms when retrieving them from the database. By this, I mean to say that I'd like to retrieve and display POJOs on the UI, and then capture their information (as Action Forms) when saving the form. The reason I want to do this is because of Hibernate's Lazy Loading feature and formatting Dates. Basically, Hibernate allows you to load children of an object lazily (i.e. resumes of a User), when the getResumes() method is called. I've created [a page|POJOsToForms] on my wiki to explain further and continue this discussion. Of course, you can always leave comments here if you'd rather - they cross-reference each other. The [RollingWiki|http://www.rollerweblogger.org/wiki/Wiki.jsp?page=RollerWikiPlugin] rocks!

Posted in Java at Jun 19 2003, 01:52:23 PM MDT 3 Comments