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 "ant". 338 entries found.

You can also try this same search on Google.

Erik's Struts/XDoclet example application

Erik Hatcher has released his "much hyped and long awaited sample application" demonstrating how to generate some Struts goodness with XDoclet. You'll be happy to know that I've been swapping e-mails with Erik a lot in the past couple weeks - so my struts-xdoclet app is very similar. Here are the details:

It is a trimmed down version of the application Steve and I developed
for our Java Development with Ant book.

Relevant to Struts folks are these tidbits:

  - XDoclet is generating struts-config.xml, validation.xml, web.xml, 
and antbook.tld

  - LabelTag (currently mysteriously busted for required tagging) is 
included.  This tag styles field labels differently if its in error, and 
(when its not busted, it works on my production app actually) it shows 
an asterisk by required fields.

  - strutsgen: a one-off starter generation for JSP's and 
ApplicationResources.properties snippets for cutting and pasting into 
the main application.  It uses XDoclet to process a specified form bean 
and uses the fields it finds for generation.

  - Use of StrutsTestCase for Cactus testing.

  - Maybe some other Struts goodies lurking there that I've forgotten to 
mention.

The application itself is a document search engine, based on Lucene, and 
should run out of the box in Tomcat or JBoss.  It even has the ability 
to (at build time) toggle between whether to use a session bean or not 
(functionality is the same either way).  By default, you can simply 
deploy the WAR that you've built and it will work without EJB, but if 
you are interested in exploring the session bean piece it can be turned on.

I am in the process of creating much more detailed documentation, but I 
wanted to get this out sooner rather than later.  If you find any 
problems or have any questions, please do not hesitate to let me know so 
I can refine it and post updates.

The one documentation I need to provide now is to note that you'll need 
j2ee.jar to build.  I include all other API's.  To build, unzip the file 
(link below) and it will expand into JavaDevWithAnt directory.  In that 
directory, run Ant.  If you have J2EE_HOME set you shouldn't need to do 
anything... just "ant".  You'll also need to build a site index, so run 
"ant build-site-index".  This is intentionally two separate steps.  If 
you don't have J2EE_HOME set, then you need to provide j2ee.jar to the 
build.  Do it this way:

	ant -Dj2ee.jar=/path/to/my/j2ee.jar

Where "/path/to/my/j2ee.jar" is the actual path to your j2ee.jar

Post any questions/problems to me directly.  E-mail me at 
[email protected].

Download: http://www.ehatchersolutions.com/downloads/

You will need JUnit 3.8(.1) as I take advantage of the new lack of 
required String-arg constructors.  junit.jar should live in 
ANT_HOME/lib.  Ant 1.5(.1) is required also.

There will be updates in the next week or so as I polish the 
documentation and address any issues that turn up.

	Erik

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

Help me rename struts-xdoclet

I've decided that I need a new name for struts-xdoclet. "Struts-XDoclet" is just too hard to say - try it, you'll see. Four syllables is just too many. Since I intend for it to be a Struts/XDoclet Jumpstart Kit, I'd like something that tries to signify that, but then again, I like POGN - Plain Old Good Names. SXJK is just as hard to say as Struts-XDoclet. I was thinking SASSY (Struts App Start ... nothing for S and Y) might be a good one - but doesn't really explain much. It'd be cool to name it Abbie, after my daughter, but I don't think sxd (hey, that might be a good one) will be that earth-shattering, and if I'm going to name something after Abbie - it better be good! I just asked Julie and her idea is to name it "struggle" - that's not bad. It eliminates the struggle in building a new webapp. Please comment your suggestions if you have an opinion.

Posted in Java at Nov 30 2002, 04:41:25 AM MST 8 Comments

Using XDoclet on Large Projects

Kurt emerges from his sabbatical (12 days is a long time in blogsphere) and mentions a little tidbit I'd like to comment on:

Last week I attending a TC JUG meeting where the topic was Struts 1.1: The Good, the Bad and the Ugly.
...
Interestingly the speaker didn't like XDoclet because he felt that on large development teams the config files should be managed outside of the source code during the design phase. Since I have never worked on a large team (not that I won't want to) I don't know if his concern is valid. Interesting comment though.

(I added the bold.) First of all, I have only recently (last 6 months) found XDoclet, and all the projects I've been on (in my entire life) have always had less than 5 coders. I've been on teams as large as 20, but the module I was working on never involved everyone. In my experience, the design phase never really consists of writing very much code or configuration, but rather a bunch of UML diagrams and static HTML prototypes.

I have found (in my brief work on struts-xdoclet) that I need to change values in my web.xml to test different settings (i.e. a servlet's init-param). However, since I'm coding some of these values in my classes, in order to change and test, I have to re-compile and deploy. Of course, I could just change the values in web.xml after I've deployed, but that's just a workaround.

A better solution, which I hope to implement, is to put certain values in my classes as tokens (i.e. @encrypt-password@) and then I can use Ant's replace task to specify this value from the command line. That way, I can set the default in my build.xml file and change it by either 1) specifying the property in build.properties, or 2) specifying it from the command line (i.e. ant -Dencrypt-password=true).

I'd be very interested in hearing anyone's war stories on this topic (managing config files in a large team).

Posted in Java at Nov 27 2002, 12:31:26 PM MST 2 Comments

Struts-XDoclet 0.2

I've posted an updated version of struts-xdoclet. I spent most of the day trying to get my build.xml and directory structure in line with Erik Hatcher's. He is planning on releasing a sample app based on his Ant book later this week, so I want to be relatively similar in our approaches. His app is a best-practices app for using Ant, JUnit and Lucene - while mine is more geared for Struts, Security and UI/Persistence Generation. I don't know if I'll commit to saying it's a best-practices app, but it's filled with a number of things I've learned in my Struts projects. I'd like to think of it as a kickstart app - kind of like struts-blank.war, but with more meat.

One of the things I discussed with Erik today was that I'd like to add the ability to choose Castor, Hibernate, EJB, or DAO with some switches in the build script. Yeah, that'll only take me until March to get done, so don't hold your breath! His response was to take a look http://www.keelframework.org/. The idea of it, supposedly, is being able to take the same business logic and swap out UI and persistence tiers easily. I guess it was started by the Expresso Team. Hmmm, I don't know if that is good or bad. I shied away from Expresso when I saw that they promoted putting a bunch of HTML into your Java classes.

Posted in Java at Nov 26 2002, 08:33:07 PM MST Add a Comment

Struts-XDoclet 0.1

I did a bunch of work today to get struts-xdoclet off the ground. Basically, all that exists write now is the generation of struts-config.xml and web.xml from xml files in a merge directory. There are no .java files in this project yet.

I'm posting this to you in hopes of getting some validation of the directory structure and Ant-based build/deploy process. The deploy task originally worked as Erik Hatcher suggests in his book, but whenever I tried to redeploy, it would give me errors when trying to remove a .jar file - so I resorted back to a simple copy to $CATALINA_HOME/webapps. The build.xml file I put together is based on what I found in struts-blank.war (for 1.1), roller's build process, my own experience and good ideas from the Ant book.

I've also configured form-based authentication and I plan to add a bunch of optional modules (i.e. SSLExt for SSL Switching, password encryption) to the mix.

I'm still searching for a sample-app idea for the persistence layer (i.e. authors and books). I'd like to do something that folks can use, so I'd definitely like to include an admin section for administering user's and their properties. Maybe even offer features such as registration (might be a bit difficult using tomcat-users.xml, but not so bad with JDBCRealm or an LDAP server), and password recovery.

You can download the first cut of this - which should build and allow you to login - at http://www.raibledesigns.com/struts/.

Next steps include the security modules I mentioned above, and generating validation.xml and persistence classes from a POJO. I'm still undecided on using Castor or Hibernate for the persistence layer. Dave (Johnson) seems to think Hibernate has some great stuff, and he's used Castor for a while, so that's probably the direction I'm leaning towards. It would be great do be able to do both.

Posted in Java at Nov 25 2002, 05:45:04 PM MST 4 Comments

JSP's Evolution

There's another interesting discussion taking place over on the struts-dev list again. Man, I'm glad I subscribed (again) to this list last week! It started out as a discussion of JSP vs. Velocity and Craig (McClanahan) provided an interesting evolution of JSP (and comparison to Velocity).

Velocity:
========

(Note -- it's assumed that the Customer collection has been stored in the
VelocityContext by some preceding business logic.)

  \#foreach $result in $results {
    <tr>
      <td>$result.ID</td>
      <td>$result.Name</td>
    </tr>
  }

JSP 1.1 (with Scriptlets):
=========================

  <%
    Customer custs = ...;
    for (int i=0; i < custs.length; i++) {
  %>
    <tr>
      <td><%= custs[i].getId() %></td>
      <td><%= custs[i].getName() %></td>
    </tr>
  <%
    }
  %>

JSP 1.1 (with custom tags):
==========================
(Note -- it is assumed here and in the following examples that the Customer collection has been stored by some preceding business logic.)

  <logic:iterate id="cust" name="custs">
    <tr>
      <td><jsp:getProperty name="cust" property="id"/></td>
      <td><jsp:getProperty name="cust" property="name"/></td>
    </tr>
  </logic:iterate>

JSP 1.2 + JSTL 1.0:
==================

  <c:forEach var="cust" items="${custs}">
    <tr>
      <td><c:out value="${cust.id}"/></td>
      <td><c:out value="${cust.name}"/></td>
    </tr>
  </c:forEach>

JSP 2.0 + JSTL 1.0:
==================

  <c:forEach var="cust" items="${custs}">
    <tr>
      <td>${cust.id}</td>
      <td>${cust.name}</td>
    </tr>
  </c:forEach>
</pre>

I can't wait for JSP 2.0 - it's going to make everything so much easier. Once again, we have exciting times for the Java world. With the power of JSP 2.0 and XDoclet, deadlines should be a non-issue. Now we just have to figure out the best way to use them, and the fastest way to pump out a Struts project. Wouldn't it be awesome if you you could add a new column to a table, build your project using Ant and XDoclet and whalla, all your classes are updated! That would be cool - and I think it's possible. Now I just have to figure out how - and fast!

Posted in Java at Nov 22 2002, 06:05:23 PM MST 6 Comments

JSP 2.0, Struts and Security

I've been asked to write some chapters in an upcoming JSP book that covers JSP 2.0 (JSR 152) and Servlets 2.4 (JSR 154). I'm thinking of doing a chapter on Struts and a chapter on Security. In the Struts chapter, I'd like to cover developing a Struts application using Ant, XDoclet and Middlegen - but I don't know if Middlegen supports Struts 1.1, nor if the generated JSPs can be modified to use JSP 2.0 syntax. I'd hate to spend a lot of time contributing to these projects to make my struts-based app work. So I'm asking you (the developers) what kind of app you'd like to see me develop?

For the Security chapter, I was thinking of developing an app that has form-based authentication, a Filter to look up the user's information, password encryption and an SSL login.

For the Struts chapter, I want to develop an app that developers can use to 1) learn about Struts and JSP 2.0 and 2) also has code they can use in their own projects. I'm torn because I really want to redo this photo album software (the site doesn't appear to be rendering images right now), but I want it to be useful. Hopefully by using XDoclet extensively, it doesn't matter what I write - the build and generation process will be useful.

My biggest hurdle to overcome in all this - it's due in 3 weeks! That should be a nice ball of stress that will keep me from sleeping night after night. Any advice or suggestions are welcome.

To see what JSP 2.0 is all about, check out the JSP 2.0 Early Access Release and here is a short and sweet article of changes.

Posted in Java at Nov 22 2002, 07:44:22 AM MST 3 Comments

How I started Raible Designs

Lance sent me an e-mail and asked, "I've been thinking of asking you about running your own business. How do you find new contracts and manage your time?" I replied to his e-mail and before I knew it, I had a story. I tend to enjoy weblogs that talk about their experiences and history, so here's a little enjoyment.

In the fall of 1998, I was working as a contractor for IBM Global Services at CoBank. I worked with a guy who wanted me to help him write a ASP-based dating application. Since I was fluent in ASP, we negotiated a rate and began moonlighting on the project after work. To facilitate me working on the project, I had to purchase a computer (Compaq Presario 5020, 64MB RAM, 300Mhz Celeron), and after the first few payments rolled in, I figured I'd better start a company for tax purposes. The project ended up fizzling out halfway through when the guy decided to re-write the whole thing in Servlets/JSP - probably a good decision, eh? With the income from the project, I was able to pay for the computer, file the paperwork for the business, and start Raible Designs, LLC.

In the midst of that project ending, someone at CoBank knew someone else that needed a website. So my first website (www.ccasla.org) for hire was born. I left CoBank for eDeploy.com and worked there for 2 years (through May 2001) as Director of Web Development. I kept doing Raible Designs stuff on the side for about 5-10 hours per week. You can find some early examples at Karen's Discount Bridal, Raskin & Makofsky and The Swan Ecosystem Center. In mid-April 2001, on the same day that I received my shiny new Dell P4 8100, the 2nd round of layoffs happened at eDeploy. There were only 3 rounds (of layoffs), and they announced the doors would be closing 2 weeks later.

So after frantically searching for a job for 2 weeks, I met with Chris Buzzetta from ICSynergy. Funny thing is that a co-worker of Julie's actually hooked me up with the interview - and everything went smooth at pie. One of ICSynergy's suggestions was that you have your own company - or at least work as a 1099 - so having Raible Designs was a big bonus at this point. I started a project with ICS at Douglas County and found myself in the world of Ant, CVS, Javadocs, and all kinds of other good stuff. In early June, I was tasked with developing a UI Framework for the County's J2EE projects, and thankfully stumbled upon Struts. In July 2001, I converted Raible Designs to an S Corp because I was now doing it full time and needed to enhance my company benefits. The DC project ended in late October. BTW, if you need a great accountant for your business, I highly recommend Lisa David of L & B Accounting.

After leaving Douglas County, I searched like a madman for weeks, but to no avail. I sent out resumes, attended User Group meetings, and e-mailed all my friends looking for a new client/job. I wanted to stay working for Raible Designs, but also needed to keep the income flowing. After finding virtually nothing, I hunkered down and satisfied a bunch of certifications (MCSE/MCDBA 2000, SCWCD, BEA Developer). In mid-December, my e-mails to friends paid off and the former CEO of eDeploy (Robert Gadd) sent me an e-mail. He said he was starting a new e-Learning company, needed a developer to produce their web-based product, and that he wanted to hire me. So it's been 11 months now, and I'm still working for Robert's company. He's been the best client in the world, and the relationship is half the fun. I've kept a close relationship with ICSynergy in the meantime, and they've helped me to get certified as a J2EE and Portal Instructor for Sun. I talked with Martin (ICS's head honcho) today and they might even have a new project for me soon.

So to make a long story longer, I find new contracts the same way that most folks find new jobs. I send out resumes (this hardly ever works), I talk to friends and I talk to old co-workers. I think the best way is to get your name out and get people familiar with what you do. Hopefully, blogging will help facilitate this even further. My partnership and friendship at ICSynergy have certainly helped a lot, and I'll be very grateful if I get my next project through them. I think more partnerships like this are definitely needed. Attending user group meetings certainly doesn't hurt. I've found that my domain name is too hard to remember though, so I bought javawebapps.com (pointed to raibledesigns.com) today. I doubt it's up yet.

As for managing my time, it's now getting very difficult with Julie and Abbie at home with me. It doesn't help that my office is in one of our common rooms, and privacy is not possible. My father recommended to spend as much time with my kids as possible, so I doubt I'll move out into a real office, but I should get my own room - with a door that closes. For the most part, I've had great success with early mornings (4 a.m.) and late nights before a release. I definitely manage my time best when I'm working on something I really like. Of course, then I work too much, and maybe that's not good time management either.

Hope this helps. Feel free to post comments or ask me any further questions.

Update: One important thing I forgot to mention. While I was working at Douglas Country, the Tech Lead on my project was Brian Boelsterli. Brian was a Principal of ICSynergy at the time, and has always been a great friend. He and I used to carpool to Castle Rock everyday, and I learned a ton from him about being an Independent Consultant, a good programmer and a good father. I eventually asked him to be my Mentor, to which he kindly accepted. I couldn't ask for a more valuable resource - he's always been full of great advice. So I encourage you to get a mentor if you know of one - all you have to do is ask.

Posted in General at Nov 14 2002, 03:36:07 PM MST 7 Comments

MiddleGen

I read about Middlegen in the Ant book I just finished. It sounded pretty cool, and now I've been encouraged to look at their site. It claims to generate EJB (CMP 2.0), JDO (1.0), or JSP/Struts (1.0) code and config files from a database. Too bad it doesn't generate Struts 1.1 code - maybe soon. It does have a GUI, but can also be run just using Ant. There are samples in the book that is oh so good. Too see it in action, check out this good ol' viewlet.

Posted in Java at Nov 14 2002, 01:35:51 AM MST Add a Comment

Neatly Packaged Binaries

Of your favorite open source products for OS X. My favs are among them: MySQL, Apache and Tomcat - all the latest versions.

Posted in Mac OS X at Nov 11 2002, 07:31:49 PM MST 1 Comment