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.

StrutsCX Article

The stats on the bottom right of this site are definitely wrong. At the time of this writing, it says I've had 4,351 hits today. Yeah right. I did, however, discover that I have been linked to in a major article and I'm getting a fair bit of traffic from that. The article is called Generate Web Output in Multiple Formats and Languages with StrutsCX and is hosted by DevX.com.

Why did the author include a link to this site? Because I'm hosting a demo of the StrutsCX application. I hope to use ideas from this app when I develop the XSL/XML rendering of resumes for my struts-resume app that I may/may not ever finish. I do plan on finishing it someday, but since I'm my own client - there's no deadline, no pay, and little motivation. But it is very cool to have my own reference application that I can play with to try new stuff. I definitely dig that. I can guarantee that as soon as I get indexed property validation working, it'll be in there - and that will also motivate adding many child items (i.e. skills, education, etc.) to the resume item.

Posted in Java at Mar 30 2003, 12:30:10 PM MST Add a Comment

WebWork Tutorial makes it look easy

I have to admit that this webwork tutorial makes WebWork look easy. In comparing this to Struts, it seems as if the Form and Action are the same thing. I wonder if I could use BeanUtils.copyProperties(wwAction, POJO) like I am with Hibernate/Struts currently.

The funny thing is that XDoclet has made it so easy (IMO) that I don't write ActionForm's anymore. All I really write is Actions, JSPs, DAOs and Services (a.k.a. Managers). So, with my current architecture I'm using, it actually looks like more work to use WebWork's Actions than Struts Actions. Especially since I have to write my validation in my Action. The XDoclet/Validator combo makes this super simple with Struts (and would with WW if they'd adopt it ;-). The only time I've been writing forms lately is when I have a form with indexed properties. Then I create a childForm that extends the generated form and has the appropriate accessors/mutators for the indexed properties.

The one thing the article does bring to light is how much cleaner Velocity is. JSP 2.0 will make JSP's a lot easier, but Velocity looks like it's already there. The one thing that worries me about using Velocity is that, according to their homepage, they haven't had a release in 8 months and their last release was a Release Candidate. What the?! Seems like someone might be dropping the ball on that project.

Posted in Java at Mar 30 2003, 11:26:58 AM MST 6 Comments

Struts Training: Week 4

I missed last week (Week 4, PosgreSQL), but I'm back this week - ready to report. I'm presenting next week on "remember-me" and XDoclet, so I'm working frantically trying to get AppFuse up-to-snuff to use as a lab template. Hopefully, I'll have that done by tomorrow night, as well as the lab and presentation.

Today's presentation is from James Turner on Indexed Properties and Validation. Awesome - I need this in my day job's project starting next week! Good timing, eh?!

So how do you use indexed properties in Forms? Two ways: Simple arrays of strings and arrays of beans (recommended). Here's a good tip - if you're using DynaActionForms, you can access a property in JSTL using {form.map.propertyName}. I did not know that - thanks James! Lots of good stuff in this one (too much to write down), I hope this preso is available online and a demo app goes with it. To validate simple array of strings, add indexedlistProperty to your <field> in validation.xml (you must also specify the property). If you're validating beans, use property="propertyName" and indexedListProperty="beanName".

However, do you really want to require all fields of your child beans? No, probably not. You (most likely), just want to require fields if some fields are populated. Struts provides us with the requiredif validator. No JavaScript validation exists for requiredif at this time. Hmmm, I wonder if XDoclet can generate indexed validation rules. Here's an example of how to do this with the current 1.1 RC1 Release.

<form name="myForm">
  <field property="lastName" indexedListProperty="person" 
    depends="">
    <arg0 key="label.lastName"/>
  </field>
  <field property="firstName" indexedListProperty="person" 
    depends="requiredif">
    <arg0 key="label.firstName"/>
    <var>
      <var-name>field[0]</var-name>
      <var-value>lastName</var-value>
    </var>
    <var>
      <var-name>fieldIndexed[0]</var-name>
      <var-value>true</var-value>
    </var>
    <var>
      <var-name>fieldTest[0]</var-name>
      <var-value>NOTNULL</var-value>
    </var>
  </field>
  ...
</form>

Note that the [0] is NOT an indicator of which indexed property to validate. RequiredIf is powerful but ugly, so James wrote something better. Unfortunately, it's too late for 1.1 and will be added for the 1.2 release. Sounds like most folks that use the Validator will be using a nightly build for awhile ;-). The new validator is called "validwhen," and looks as follows:

<field property="firstName"
  indexedListProperty="dependents"
  depends="validwhen">
  <arg0 key="dependentListForm.firstName.label"/>
  <var>
    <var-name>test</var-name>
    <var-value>((dependents[].lastName == null) or
                (dependents[].firstName != null))
    </var-value>
  </var>
</field>

Fricken sweet! James is sending me the code - cool! This will make my life soooooo much easier next week. Status of Struts 1.1 from James: they're working on getting the commons packages to a release state. Slides from today will be available at strutskickstart.com later this afternoon.

Posted in Java at Mar 29 2003, 09:32:28 AM MST 4 Comments

Which caching framework to use?

I discovered this afternoon (after I got everything working - thanks to Jason's comment) that the main process in the webapp I'm building (day job) takes 15 seconds to process. It could be have something to do with the fact that the HTML page itself is 1.5MB of data (view-source, save as). And it's a very lightweight page as we're using strict XHTML and mucho CSS. So now it's time to start looking into caching frameworks. For the web/JSP side, I'll probably use OSCache. It's seems to be more tried and true, and commons-cache is still in the sandbox. If any of your have experience, chime in so I don't pick the wrong one! Another method I'm going to try is using JCS with Hibernate. Since I'm using XDoclet already, all I have to do is add the following to the top of my persistable objects.

@hibernate.jcs-cache usage="read-write"

Posted in Java at Mar 26 2003, 04:40:52 PM MST 2 Comments

Struts Upgrade: 1.1 RC1 to Nightly Build (20030326)

I decided to upgrade from Struts 1.1 RC1 to a nightly build this morning, hoping to get the fix for the Validator bug that requires an Internet connection. I was also hoping to solve an issue I have where Eclipse thinks that ListUtils.sum(list1, list2) is deprecated (not so according to it's JavaDocs - Ant doesn't seem to think it's deprecated either... wierd). However, instead I was greeted with a couple of new deprecation errors that you might want to know about.

  • ConvertUtils.setDefaultLong(long) has been deprecated. Again, not according to its javadocs.
  • Action.MESSAGES_KEY deprecated in favor of Globals.MESSAGES_KEY

The good news is that the Validator bug is indeed fixed and I don't have to set my proxy host/port variables for Tomcat anymore.

Posted in Java at Mar 26 2003, 11:23:24 AM MST 3 Comments

DBUnit and CLEAN_INSERT

A few days ago I was trying to hook DBUnit into my test process so that my database would contain the same data before my JUnit tests are run. I had some issues getting it to work and later found that there was a bug in DBUnit's ant task. Basically, it was not allowing me to disable batch statements. Anyway, it's been fixed in CVS and now my JUnit tests (all run through a common test-module task) depend on a "db-load" task. Pretty cool and awful easy to configure. I'll be updating struts-resume/appfuse in the next few days to contain this slick trick. In the meantime, here's my db-load target. The file sample-data.xml is also built using Ant via DBUnit's "export" task.

<target name="db-load" description="Loads database from exported DBUnit file">
    <property name="operation" value="CLEAN_INSERT"/>
    <property name="file" value="metadata/sql/sample-data.xml"/>
    <dbunit driver="${hibernate.connection.driver_class}"
        supportBatchStatement="false"
        url="${hibernate.connection.url}"
        userid="${hibernate.connection.username}"
        password="${hibernate.connection.password}"
        schema="${hibernate.connection.schema}">
        <operation type="${operation}" src="${file}" format="xml"/>
    </dbunit>
</target>

Posted in Java at Mar 25 2003, 11:13:58 AM MST Add a Comment

[ANNOUNCE] Display Tag Library 0.8.5 Released!

I spent some time yesterday assembling the release notes, enhancing the build process, and updating the documentation for the display tag library. The result is a new release!

This release is primarily a bug-fixing release and also represents the first release from the project at SourceForge. If you would like to have a say in the future direction of this project, please join one of the mailing lists. [Release Notes] [Download]

Enjoy! I updated two projects with this new release today and it helped eliminate a lot of "workaround" code I had. The next thing I'd like to see - the ability to specify ResourceBundle keys for column titles.

Update: Ed Hill has updated this project's homepage with the latest examples and documentation.

Posted in Java at Mar 24 2003, 09:26:52 PM MST 3 Comments

Life as a Contractor

This weeks sucks to be a contractor. It's a 2-day week and that's all I'm getting paid for - 2 days. Damnit, wish I was full-time. Then again, if I were making the big bucks, 2 days would be plenty to pay the mortgage. Alas, I am not - and I'm tempted to work this weekend. What the hell is wrong with me - work on the weekend?! I make fun of my friends when they work on the weekend - now I'm a hypocrite. I have a to do list that makes my weekend boring as all getout:

  • work 10-12 hours at day job
  • add user administration to struts-resume
  • release appfuse
  • finish new design prototype for client
  • release displaytag (no one else seems to want to do it)
  • clean the house before Julie gets home

No wonder I miss Julie and Abbie so much when they're gone - I sit in front of the fricken computer all the time! When I get out of the house (or simply off the computer), I find I miss them much less (it's been almost 2 weeks!). I might have to scrap my to do list (save the paid part - item 3) and get off the damn computer. Booking happy hour and ski dates shortly... ;-)

Posted in General at Mar 21 2003, 04:07:13 PM MST 2 Comments

DBUnit has released version 1.5

I'm using DBUnit on all many of my personal projects (appfuse, struts-resume, security-example, day job) right now and I really dig it. It makes things so much easier. Mainly I've been using it to populate a database with default data, and haven't made my JUnit tests depend on cleaning/inserting. Today I've decided to tackle this issue (clean, insert, run test) - so I trotted on over to dbunit.org and discovered a new version (1.5) was released at the beginning of this month. I'm hoping (haven't tried yet) that I can do an export and CLEAN_INSERT and my task will be finished.

BTW, I dislike the case of the name "Dbunit" and I prefer "DBUnit," so that's what I'll be typing it as - hope you don't mind.

Posted in Java at Mar 21 2003, 11:31:51 AM MST Add a Comment

What to do with my Chapters?

Julie suggested I just post them on this site. Then I got to thinking - what if all the authors made a PDF version of the book, and it was downloadable as the whole thing or as selected chapters. Let's say $5/chapter and you can pick and choose whichever ones you want. Sounds like a good idea, but the problem would be protecting the PDFs from being shipped around between friends. Or we could just give them away, in hopes that our knowledge would inspire others to hire us (as in a new job or a new book).

I don't know what to do, but I'd like to get my chapters out somehow. I'm afraid that if I just sit and wait, they'll never get out, and the technology will be old news shortly. The stuff I wrote about has staying power, but only until the next version of XDoclet and Struts.

I guess the good news is that I'll keep struts-resume up to date with the latest version, but the writing will be out of date by the end of the year.

Posted in Java at Mar 16 2003, 10:15:44 AM MST 5 Comments