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 "struts". 749 entries found.

You can also try this same search on Google.

Struts 1.1 Final ~ might be released on Sunday

According to the struts-user mailing list, the Struts Dev Team is going to try and release 1.1 Final this weekend! Sweet!

From: Ted Husted
Subject: Re: [ANNOUNCEMENT] Struts 1.1 Release Candidate 2 released
Date: Wed, 25 Jun 2003 03:30:47 -0700 
-------------------------------------

Just a note on the RC2 status.

Martin posted the release vote for FileUpload on Monday, and there
are already 3 binding +1s. <yeah!/>

We've one outstanding Bugzilla ticket against RC2, which we should 
be able to either resolve or postpone. Given the imminent release 
of FU 1.0, I plan to post the Struts 1.1 Final Release vote 
tomorrow, so that we can roll it out on June 29. <double-yeah!/>

-Ted.

This doesn't mean much to me since the current RC2 release works fine for me (if I didn't, I'd use a nightly). However, it's cool that this is finally being released. It's too bad it took so long - such is the nature of open source - I probably won't release struts-resume 1.0 until 2004. And who knows when Roller 1.0 will be released...

Posted in Java at Jun 25 2003, 08:34:10 AM MDT Add a 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

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

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

www.mail-archive.com

If you're doing development on an open source project, I recommend that you get your mailing list archived by mail-archive.com. It's pretty easy to setup and offers a nice google-like search interface. I recently added struts-apps, struts-menu-user and the display tag lists. I hope this makes it a lot easier for folks using these applications. I might even add Roller, but I figured Dave could handle that if he really wants it (it's already being done by gname anyway).

Either way, gname or mail-archive.com, if you're using a SourceForge mailing list, you'd better get a better archiving system b/c SourceForge's sucks! Why? No searching! What good is an archive without searching?!

Posted in Java at Jun 19 2003, 12:51:44 PM MDT 2 Comments

[Display Tag] Now we're talking...

We're starting to get some real activity over on the display tag library project. I have to admit, I've done nothing - which is why it's even cooler that other folks are. Mathias joined the team and went on a rampage squashing bugs and formatting code. Then along came a guy named Fabrizio (no blog) who re-wrote the whole thing ~ demo. Even better - it's XHTML and CSS compliant.

There's even an editable table prototype being looked at. John York (no blog) has also done a lot in re-writing the library, and has his own version that I'm hoping to post soon. Nice work gents!

Posted in Java at Jun 17 2003, 03:16:20 PM MDT 11 Comments

Testing Roller's WikiPlugin

Does this sucker work as designed? I hope so. Let's test out linking to my Struts Resume Support page. It looks like it still needs some work. My suggestions for improvement:

  • Use valid HTML - this is probably a JSPWiki thing. All the attributes in my links are currently uppercase - invalidating my XHTML. It's not valid with twisty comments anyway, so I don't care too much.
  • Produce the same HTML in my RSS Feed as is presented in the HTML version. Actually, it looks like it's just the <description> element that's still wiki-fied.

This is a very cool plugin and makes it much easier to type a post. It'll take a little getting used to, but it is very slick. As a demo, here's the text I entered.

!Does this [sucker|http://rollerweblogger.org/wiki/Wiki.jsp?page=RollerWikiPlugin]
work as designed?  I hope so.  Let's test out linking to my 
[Struts Resume Support|StrutsResumeSupport] page. It looks like it still needs some 
work.  My suggestions for improvement:

* Use valid HTML - this is probably a [JSPWiki] thing.  All the attributes in my 
links are currently uppercase - invalidating my XHTML.  ''It's not valid with 
twisty comments anyway, so I don't care too much.''
* Produce the same HTML in my [RSS Feed|http://raibledesigns.com/rss/rd] as is 
presented in the HTML version.  '' Actually, it looks like it's just the 
&lt;description&gt; element that's still wiki-fied''.

This is a __very cool__ plugin and makes it much easier to type a post.  It'll 
take a little getting used to, but it is very slick.

Posted in Roller at Jun 13 2003, 10:09:08 AM MDT 1 Comment

[ANNOUNCE] XDoclet 1.2 Beta 3 Released!

From the XDoclet News page:

This is the last milestone towards our next big release. Over 130 bugs are fixed. For a detailed change log, please refer to XDoclet 1.2 Beta 3 Change Log.

Cool! Downloading now...

15 minutes later: I suspected this as soon as I saw the download. You'll need to download XJavaDoc 1.0 along with this release. I installed this release (+ xjavadoc) in my appfuse-based project at Comcast, and everything just worked. I dig it.

Posted in Java at Jun 13 2003, 07:28:36 AM MDT 6 Comments

[ANNOUNCE] AppFuse 0.8 Released!

Not much new in this sucker ~ the main reason for this release is to demonstrate self-registration (and auto-login) in a CMA (Container Managed Authentication) environment. I also upgraded most of the dependent packages (i.e. Struts, Hibernate) to their latest releases, and added a binary release as an optional download. [More, Download, Release Notes]

For those of you that might not know, AppFuse is a project I created in order to help me ramp up web development projects faster. I've found it takes a long time to start a project and get the directory structure, build files (incl. ant tasks for junit/cactus/canoo) and all that jazz in place - so I created appfuse. I created it for myself, I'm using it currently at Comcast, and it works great. You might say that "Maven already does this" - and you're right, but I wanted to do it the Erik Hatcher way (after reading his book). I may make an attempt to mavenize the project in the future, but I currently don't see the need.

Posted in Java at Jun 12 2003, 01:08:14 PM MDT 2 Comments