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.

My Last Project ~ now in production

The initial site we created at my last project has been deployed to production. Actually, I believe it was deployed the day after I left, but it's cool to see something I helped create actually running on the web. Most projects I work on are either internal, or require authentication. We ended up implementing all the static content using Velocity (thanks to Erik for his help) and the menus (both top and side, once you drill down) are powered by Struts Menu. We actually figured out a pretty slick way to create each individual site (there will eventually be 55 of them), all using the assembling powers of Ant and the magic of Velocity (which I've grown to love).

Posted in Java at Nov 12 2003, 11:39:23 AM MST 1 Comment

The good ol' Struts vs. WebWork Debate

Jason Carreira has been nice enough to post a technical comparison of Struts vs. WebWork. Don Brown (creator of many Struts add-on packages) and Jason have been going at it ever since. It's funny, there's a small part of me that doesn't believe there's a future for Struts (because of JSF). I believe that JSF and WebWork are quite similar, and if I'm going to take the time to learn a new framework, I should learn JSF. Why? Because, I'm willing to bet the literature for Struts -> JSF is out there, and there's probably no literature for Struts -> WebWork. Also, I believe there will be JSF jobs in the near future, but not many opportunities for WebWork. In a perfect world, I'd do something like Kris is doing and learn them all - extend AppFuse to support my favorite framework (if I find one better than Struts) after the learning process, and use that for new projects.

Where does Kris find the time to learn all these frameworks? I barely have enough time to workout and complete my 8-hours-per-day of productivity-for-pay. Then again, I've been getting up around 7:30-8:00 a lot lately vs. the usual 4 a.m.

In my current gig, I'm teaching a fellow programmer how to write webapps in Java. He's never written Java, HTML, CSS or JavaScript. He wants a tool to do it all - so he can drag-n-drop, point-n-click and voila - he's created a webapp. This is a fundamental problem with J2EE - it's not possible? Or maybe it's the beauty - you have to get down and dirty with the code to create a webapp. Another issue is that we're using Struts Resume as our baseline and architecture - and there's really nothing in this app that's drag-n-drop or tools-friendly. Everything is Ant, JUnit, Struts and Hibernate. You have to be somewhat familiar with all of these to build/deploy this app. Personally, I like getting down-n-dirty with the code, but that's because I'm familiar with it and have been working with it for years. Teaching someone else how to get down-n-dirty (and to like it) is proving to be a whole other battle.

Posted in Java at Nov 12 2003, 06:17:46 AM MST 12 Comments

[New Book] Art of Java Web Development: Frameworks and Best Practices

Book Cover Manning has a new book in the works: Art of Java Web Development: Frameworks and Best Practices. Looks like good stuff - it covers Struts, Tapestry, WebWork, Velocity and Cocoon. Too many books, not enough time. I'm thinking that I should start taking a "studying sabbatical" every year. Maybe 2 weeks at the end of each year where I crank through a few books and solidify my knowledge. The other option is to quit contributing to Open Source and reading weblogs - that'd probably save me 2 weeks between now and the end of the year. ;-)

Posted in Java at Nov 06 2003, 08:49:07 PM MST

My Development Environment

To make is easier for folks to use AppFuse and Struts Resume, I put together a page for HowTo Configure your Development Environment. This is how I've configured my environment and it works pretty darn well for me. Really, none of the document is AppFuse specific - it just shows where I put J2SE, J2EE, Ant, Tomcat, and how to setup your environment variables. Comments or other suggestions are welcome.

Posted in Java at Nov 06 2003, 01:59:36 PM MST 2 Comments

Hibernate 2.1 Beta 5 Released!

Normally I wouldn't announce a Hibernate beta release (since it is a beta and I'm not currently using it), but there's a bunch of bug fixes (see release notes) that folks might be able to use. You can also download this bad-boy if you so desire.

On a side note ~ I find it amusing how my real-world projects influence my open source contributions. I don't follow Hibernate much because I don't use it day to day. On my last few projects, I've used it a lot. When I've used it, I've also used AppFuse, and therefore - I tend to contribute the AppFuse's development more. Same goes for the displaytag - which I haven't used in a project in several months - hence, no code commits from me. The good news is that on my current project, I have been using Struts Menu a LOT and I've committed some wicked new stuff to CVS. I'm busy writing documentation on it now so it will be easier to use for all. Maybe I'll try to convince my next project to use Roller for Project Status Reports...

Posted in Java at Oct 30 2003, 04:56:55 PM MST Add a Comment

AppFuse and all it's libraries

I received a question about AppFuse that I've been pondering every since. The question basically boils down to two things:

  • How do you manage Eclipse's .classpath file in conjunction with lib.properties (the file that manages it for Ant)?
  • When using AppFuse for multiple projects, do you put a "lib" folder in each project or use a central repository?

Quick Answers: I replace files in the appfuse/lib directory and update lib.properties. Then I update my project properties in Eclipse to reference the new jars. A pain, yes - but only a 2 minute process. I run all my tests before I bother changing the Eclipse classpath. As for multiple projects - the easiest thing to do is to move $yourProject/lib to a folder called "libs" in the same directory as $yourProject and change the ${lib.dir} property in properties.xml to point to the new folder.

Begins Rambling... I'm currently using AppFuse on 3 different projects. 1 is AppFuse itself, the 2nd is Struts Resume, and the third is for a client I created a webapp for in August. Right now, when I synch up Struts Resume with AppFuse, I copy paste from appfuse/lib to struts-resume/lib and update the lib.properties appropriately. I can't just copy lib.properties to struts-resume/lib because struts-resume uses libraries that appfuse doesn't. Yes, this is admittedly a pain in the arse. It's almost as bad as changing all the method signatures when moving the Hibernate Session from all method signatures into the constructors (can your IDE do that?!). I don't want to make people download appfuse to build struts-resume though, so I doubt I'll change this process.

The whole "massive lib folder" has been bouncing around in my head for quite some time. I'd like to use Maven or Greebo to download the dependencies for AppFuse, but at the same time, it's nice being able to download the whole thing at once and be up and running. I don't want to go the Maven route because I don't really want/need a website for AppFuse and it sounds tough to get it working with XDoclet (though WebShop looks like it might be a good template). KISS

The project.xml in AppFuse is my feeble 20-minute attempt to get it Mavenized (it's currently not used). I tried Greebo this morning, and it really does nothing for me. Especially since I've setup separate compile/test classpaths (read from lib.properties). It'd be a real pain with Greebo to separate out the classpath's for testing and building - it seems to only support one long classpath. Also, who wants to make their whole best-practices open-source app dependent on a 0.1 open-source app?

As for having my IDE (wether it be Eclipse or IDEA) reading the classpath from Ant - that would be the sweetest feature of the year! Currently in Eclipse and IDEA, I have to give an absolute path to j2ee.jar since I don't want to distribute it (it's 11 MB). When I switch b/w OS X and WinXP, I always have to change this classpath. I'm sure there's an easier way with setting variables in the IDE, I just haven't figured it out yet.

The other thing that is annoying is that IDEA doesn't seem to read my $ANT_HOME environment variable. Does it have it's own $ANT_HOME? It's annoying for me b/c I check for JUnit classes in the classpath in my "init" task, and IDEA doesn't find them. Don't worry Eclipse bashers - it doesn't work in Eclipse either. This is fine with me b/c I prefer the command line, but those "I use my IDE for everything" folks might not like it because they can't run AppFuse's build.xml file from w/in their IDE.

Posted in Java at Oct 23 2003, 06:21:59 PM MDT 7 Comments

Upgrading from Struts 1.1 to Nightly build

I'm upgrading our application at work to the nightly build (20031020) of Struts in order to use the validwhen Validator. I found a few deprecations and errors in the process, so I thought I'd share to help others upgrade easier:

  • ActionError has been deprecated in favor of ActionMessage. Likewise, ActionMessages.GLOBAL_MESSAGE replaces ActionErrors.GLOBAL_ERROR.
  • Methods in ResponseUtils have been deprecated in favor of TagUtils' methods.
  • RequestUtils.message has been deprecated in favor of TagUtils.message. Other methods include RequestUtils.lookup.
  • Many of the methods in TagUtils aren't static (they where were in Request/ResponseUtils), so you have to create an instance of TagUtils. Anyone know the logic here?
  • ValidatorResources.get deprecated in favor of ValidatorResources.getForm.
  • ValidatorForm.getFieldMap() is gone, which no apparent replacement method (at least not in the JavaDocs).
  • The Tiles' Controller interface's perform method has been deprecated in favor of execute. You gotta love this one - while perform has been deprecated, you must use it or you will get a compile error saying you must implement it (or declare your class abstract). Same goes for execute. So to upgrade, I had to implement both methods - where my perform method calls my execute method.
  • org.apache.commons.lang.NumberUtils moved to org.apache.commons.lang.math.NumberUtils
  • org.apache.commons.validator.ValidatorUtil moved to org.apache.commons.validator.util.ValidatorUtils
  • stringToInt(java.lang.String) in org.apache.commons.lang.math.NumberUtils has been deprecated. Not according to the its JavaDoc.

Final tally - two deprecation errors that don't seem to have replacements (yet):

    [javac] .../src/web/org/appfuse/webapp/filter/BreadCrumbFilter.java:182: 
        warning: stringToInt(java.lang.String) in 
        org.apache.commons.lang.math.NumberUtils has been deprecated                                                                                                  
    [javac]        int mSS = NumberUtils.stringToInt(temp);                                    
    [javac]                                  ^                                                      
    [javac] .../src/web/org/appfuse/webapp/taglib/LabelTag.java:71: warning: 
        getFieldMap() in org.apache.commons.validator.Form has been deprecated                              
    [javac]        Field field = (Field) form.getFieldMap().get(fieldName);               

Later: Thanks to Steve Raeburn (via the struts-dev mailing list), I now have no deprecation errors. NumberUtils.stringToInt(String) is now NumberUtils.toInt(String) and Form.getFieldMap().get(String) is now Form.getField(String). Thanks Steve!

Posted in Java at Oct 20 2003, 10:22:00 AM MDT 2 Comments

Web Frameworks - which one should I learn?

I've seen a lot of talk about Web Frameworks these last couple of weeks - particularly JavaServer Faces, WebWork and Spring. There's also been great articles posted comparing Spring and WebWork as well as an Introduction to Spring from TSS. Spring, WebWork and JSF all look like excellent frameworks to me, but I also continue to believe that Struts is a great framework. And I would go so far as to say that it's the best web application framework. Yep, I said it - Struts is the best web application framework to learn if you are a web developer wondering what to learn. Why? Because it will get you a job.

I've continued to receive a fair amount of calls and e-mails over the last couple of weeks - and they're all calling because of my Struts experience. Good luck in finding a company that wants you to build their web application using WebWork or Spring. Maybe someday I'll be lucky enough to hire employees for Raible Designs and build web applications in my own office with my own employees. Then we'll get to choose whatever technology we want to build customers' apps. Until then, I'll stick with Struts and continue to be an employed developer.

I strongly believe the best way to learn anything is to get paid to do it. I've learned Struts over the past couple of years, not because I wanted to, but because someone else wanted me to - and they paid me to do it. Of course, there are some companies that will probably pay you to learn WebWork or Spring, but most would rather not.

Another thing to consider is that WW and Spring will probably someday develop "migrating from Struts" documentation. Sounds like a good idea to me - until then, and until someone pays me to learn the others, Struts is #1 for me.

Now it's your turn to tell me why my logic is flawed... if you can. ;-)

Posted in Java at Oct 17 2003, 01:22:23 PM MDT 21 Comments

JSF Presention and sample code

David Geary's Presentation and sample code from last week's DJUG Meeting can now be found online. From Tom McQueeney, DJUG's new president (congrats Tom!):

For those that missed last week's meeting, David introduced us to the new JavaServer Faces specification, now in its 4th "early access" release on the Sun web site. David considers JSF to be a "Struts killer" once the standard takes hold within the development community and tool vendors. The JSF 1.0 final spec is expected to be released early next year.

Early next year == March from what I've heard...

Posted in Java at Oct 16 2003, 10:36:10 PM MDT Add a Comment

JSTL and Dreamweaver has JSP Tag Completion

I discovered today that there is are new releases of the JSP Standard Tag Library over at Jakarta's Taglibs project. JSTL 1.0 has a Standard 1.0.4 release from September 25th, and there's also an early access 1.1 release (for Servlet 2.4/JSP 2.0). If you're doing JSP development and you're not using JSTL, you'd better start - these tags are huge timesavers and are fairly easy to learn (especially if you know JavaScript).

I also discovered a nice feature in Dreamweaver 2004 - Tag Library code completion. I believe Dreamweaver MX (v6.0) had this as well, but I never use DW on a PC (it's too slow). Now that I'm giving a go at using OS X all the time, I need to use DW so I can get an explorer-like window (BBEdit doesn't seem to have this). It's pretty slick - you just import the .tld or .jar and whalla - you've got tag library code completion. The one downside is that it does not support importing multiple libraries from one JAR file (i.e. Struts or JSTL), so you do have to import the .tld files (selecting all .tld files in a directory works). It might actually be worth the $400 if I keep developing on a Mac. I don't know about IDEA - I started using Eclipse today after using IDEA for the past week and it felt like I was home again.

Lastly, iBatis has a new release. I upgraded from 1.2.7b to 1.2.8 in my current project and all our tests ran without a hitch. Gotta love unit tests.

Posted in Java at Oct 16 2003, 05:19:39 PM MDT 4 Comments