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

You can also try this same search on Google.

[code sample] Using RowSetDynaClass from BeanUtils

On the struts-user list, they're discussing O/R Mapping tools. There seems to be lots of support for OJB and Torque, and I seem to be the only one that piped up for Hibernate. Meanwhile, Craig McClanahan (lead Struts Developer) sent an interesting code sample of using the new RowSetDynaClass to create a collection of DynaBeans from a ResultSet.

Posted in Java at Feb 05 2003, 08:31:02 AM MST Add a Comment

Hibernate Doco Goodies

The Hibernate Developers have added some new documentation to their site. If you've worked with Hibernate at all, or you're hoping to, these are a must read. I still haven't figured out the parent child stuff with composite-ids, and I'm hoping these two links will help show me the light. I'll make sure and put an example into struts-resume if/when I figure it out. To quote:

Everyone should read these newly added pages: Parent / Child Relationship and Understanding Collection Performance.

Thanks to whomever contributed this documentation. FYI, I sent a e-mail to the xdoclet-devel mailing list re: Hibernate 2.0 DTD support, but haven't heard anything yet. I'd probably have better luck if I just contributed a patch. This week looks like a bad week for open source moonlighting - I've got a 4 days to get 40 hours in, and my part-time client wants me to pump out a new feature before I head to Steamboat for the weekend. Life is good as a person/father, but poor right now as an OSS Developer. I feel like a slacker, but I'm happy so that's good - it's all about priorities right?! ;-)

Posted in Java at Feb 03 2003, 10:10:00 PM MST Add a Comment

[SOLVED] Connection Timeout using Oracle with Tomcat

I finally solved the problem I was having where the DBCP Connection Pool in Tomcat kept getting closed. At first, I thought it was happening every 24 hours. After we configured connection logging in Oracle, we discovered it was happening every 2 hours. After posting numerous (likely annoying) messages to tomcat-user and struts-user (with no resolution), I looked up my local Oracle user-group mailing list and fired off a message.

The first (and only) response solved my problem. It said I should check and see if there is a connection timeout on the firewall. Sure 'nuff, 90 minutes. So I wrote a DBPingServlet, coupled with an Ant task to make an HTTP Request to get the servlet, and scheduled it as a cron job. Whalla - the problem is fixed! Thank God - it was annoying to restart Tomcat every 2 hours! Of course, if folks where actually using our application - this would've never been an issue... ;-)

Posted in Java at Jan 30 2003, 03:17:35 PM MST 1 Comment

RE: Display Tag Library - donate it!

Shortly after posting my donate plea yesterday, I sent a similar message to the struts-user group and cc'd Ed Hill. Lo and behold, I got the following reply from Ed:

I would gladly support any efforts to continue (restart) development on my taglib. I've reserved some sourceforge space myself, but have not moved things over yet. Alas, it currently does what I need it to do and other priorities have well taken priority.

If someone steps up to volunteer to be the pumpkin keeper (sorry, Perl cultural reference), I will do what I can to help (redirect my web site on my personal machine to the new home, etc...)

I don't subscribe to the struts-user list, so if you would please forward this on to encourage any discussion, I would appreciate it.

Thank you!

Cool, I'll see what the struts-user list says today (I only subscribe to this 150+ message-a-day list at work), and see if I can find a pumpkin keeper.

Posted in Java at Jan 23 2003, 04:51:45 AM MST Add a Comment

Display Tag Library - donate it!

If you need a slick JSP Tag Library for sorting and paging data, the display tag library is a great library to use. However, it's got issues - just like any piece of software. I've fixed a couple on my own, but it definitely needs some work - and integration with Struts (i.e. for getting messages, or referencing forwards) would be awesome.

The problem is that Ed Hill doesn't seem to be working on it anymore - and there hasn't been a release since May 2002! Since I do have the source it wouldn't be hard to create a project at SourceForge for it. It would be great to get some input from Ed though. Last year, I think he even did a presenation on JSP Taglibs at Java One! I know there's lots of Struts developers that use the <display> tag - I wonder if they'd be interested. I think I'll send this to the mailing list (and cc Ed) and see what happens.

Posted in Java at Jan 22 2003, 10:01:36 PM MST 1 Comment

Commons Lang: StringUtils

My new favorite method is the equals method on Commons Lang's StringUtils class. It takes the check for null out of your logic and can help you create cleaner code. Before using it you might have to write something like this:

if (request.getParameter("checkbox") != null 
    && (request.getParameter("checkbox").equals("true"))) {

With StringUtils.equals(String, String), you get a little less coding:

if (StringUtils.equals(request.getParameter("checkbox"), "true")) {

If you're using Struts or some other library that already depends on commons-lang, why wouldn't you use it? Possibly performance reasons, but I doubt it causes much of a hit.

Posted in Java at Jan 22 2003, 06:05:51 AM MST 4 Comments

Using XDoclet to generate your validation.xml?

Are you using XDoclet to generate the validation.xml file for Struts' Validator Framework? If you're using Struts and you're not using the Validator - you should be IMO. It makes both client-side and server-side validation soooo simple. Using XDoclet to generate the key file (validation.xml) makes implementation a piece of cake. We have Erik to thank for this wonderful addition to XDoclet. Much appreciated sir!

I'm guessing that not many people are using this feature b/c it works kinda funky right now. It disregards the order of your properties in your ValidatorForm and generates entries in alphabetical order. This is great except the client-side (JavaScript) piece of the Validator uses the order to determine which fields to validate first. This has caused a slight headache for me on my project, so I fixed it. Checkout XDoclet's JIRA for the bug and the patch. Hopefully it'll get committed soon, but in the meantime, I'll continue using my patched Apache module that allows me to generate ActionForms from POJOs and orders my validation.xml correctly.

Posted in Java at Jan 21 2003, 10:12:23 PM MST 6 Comments

xPetstore v2.2 Released!

I haven't looked at it much or used it at all, but it sounds good.

xPetStore is a WODRA (Write Once, Deploy and Run Anywhere) implementation of Sun PetStore application based on the following opensource tools/framework:
- XDoclet
- Struts
- SiteMesh

If you're writing web applications (and you're using Struts or Webwork) and you're NOT using XDoclet (or one if it's derivatives - i.e. Middlegen), you're wasting your time (IMHO). Of course, I also believe that if you're not using Ant to build your java-based project, you're really wasting your time.

Hmmm, while over at the WebWork site, I stumbled upon this Eclipse + Resin + WebWork + Hibernate tutorial. I don't know if it's such a good idea to call your persistence layer directly from your servlets is it? Shouldn't that be in a Business Delegate - or am I losing focus of KISS and trying to follow too many patterns? Patterns give me more opportunities for Unit Testing. The only way to test this servlet would be something like Cactus, right? As always, to each his own... ;-)

Posted in Java at Jan 19 2003, 10:24:25 PM MST 1 Comment

Struts 1.1 is on its way

Struts is definitely due to release 1.1 very soon. I've been using nightly builds for the last year - all very stable. There was a vote posted to the struts-dev mailing list tonight on releasing 1.1b3 as 1.1RC1 and it looks like it will pass. According to the committers, I'd expect an RC2 (with bug fixes only) in early February and a final release at the end of February. Luckily, all my clients have been confident in me and have not cared what version of Struts I was using - just that it worked. When I've found problems, I've patched them - good ol' open source. I haven't found any issues in quite some time - and when I have, the committers usually fix them the same day. Gotta love that kind of customer service. Show me a company that can do that with commercial software and I'll be impressed.

Posted in Java at Jan 17 2003, 11:21:11 PM MST Add a Comment

ConvertUtils and Indexed Properties

Now I have a new issue with ConvertUtils. I've resorted to creating a Form, rather than generating one from a POJO using XDoclet. In this form, I've added indexed properties, so that properties can be accessed and retrieved with an index.

So now I have getPropertyList() and setPropertyList(ArrayList) on my form. I also have getPropertyList(int index) and setPropertyList(int index, Property prop). However, when I add these methods, my ListConverter.convert method quits working! So now when I call:

BeanUtils.copyProperties(cmcfForm, c);

it returns null for the ArrayLists on my form? I don't get why, esp. since the methods have different signatures. It works fine if I remove the indexed methods.

Update: I solved my problem by removing the getPropertyList(int index) method. I had to add some funky stuff in the reset method of my Form to ready it for Struts auto-population, but it works. Specifically, I had to create an ArrayList for my child, and then populate it with empty child forms. This allowed setPropertyList(int index, Property prop) to work as expected. FYI - I don't think this is a Struts thing, but how webapps work. Anyway, I'm happy with how this works - as I know have indexed properties working for display and saving. Now I have to figure out saving parents/child in Hibernate (I've done it with struts-resume and MySQL, just not with Oracle). I've posted my problem to the Hibernate mailing list if you're really interested in my problem.

Next up, indexed property validation using the Validator. Should be oh so fun...

Posted in Java at Jan 16 2003, 11:03:31 AM MST Add a Comment