Fog Creek Software
Discussion Board

will struts save me time?

I have a contract coming up to build a series of wizard-like input forms for a java web application. Most fields will need some amount of validation but nothing complicated. I have bad memories of a previous project where I ended up writing tons of servlet code for what I thought was going to be "simple" form handling. 

I'm trying to find the best way to do this writing the least amount of code. Will the "DynaActionForm" in struts help me out in this regard?

Friday, April 25, 2003


Daniel Shchyokin
Saturday, April 26, 2003

is there anything that will?

Saturday, April 26, 2003

I found that writing a kind of mini-language helped the most. That language let me define online forms, and then would generate the HTML and validation code needed.

Once the initial effort of passing the mini-language was done I could knock up a very complicated form in minutes.

Matthew Lock
Saturday, April 26, 2003

The Struts taglib can help you for quick easy field syntax validation. Combined with the power of ActionForm (method validate), you can do whatever you want.

Only problem, it takes some times IMHO to really understand well Struts, so you may not gain a lot of time for your 1st use.

Struts is for the time being the de facto standard for java web MVC application. I do recommend it.

Robert Chevallier
Saturday, April 26, 2003

I've got about 6 years of Java experience - I wouldn't say I know it perfectly but I'll have a good idea about what to do in most situations.  After a nasty time coding a JSP+servlets web front end to an application, I decided for the next one I would use struts...

I only had two - four hours a day, and it took me about six weeks to get to a 'business as usual' level of struts knowledge where I'd know how to do something if asked.  It was perhaps compounded by having to learn an object-relational library at the same time, but it did take me a lot of time to get up to speed with struts and how to achieve things that I could easily have achieved in plain servlets and JSP - there are a few quirks.

The flipside is that once you are established with it, it is versatile enough to do the job, combined with Tiles, you've got a very effective platform for creating web applications and I now prefer to use it on small jobs as well.

In short, if you are under time constraints, I'd recommend that you don't go ahead with using struts unless you can afford to lose two weeks, but that's only based on my experience.  I'm not sure whether I'm a slow learner or not, based on past experience I'd say no, but your mileage may vary.

Saturday, April 26, 2003

You can use Struts Validator component and write all your validation rules into XML configuration file. Since you wouldn't need custom ActionForm classes for validation, DynaActionForm is the only ActionForm you'd need.

Saturday, April 26, 2003

Struts has saved me a fair amount of time.

I recommend Struts in Action by Ted Husted or The Struts Framework by Susan Spielman to get up to speed quickly. Other Struts books might be pretty helpful too.

I think the biggest hurdle for me was the installation. There are a couple xml and .properties configuration files that you need to set up to get the full use from struts. Of course I just downloaded struts and used the example application as a starting point. The "Struts in Action" book contains a nice chapter telling you everything you need to do. I think I could have been up and running much faster if I had bought the book first.

Monday, April 28, 2003

take a look at the framework which Enhydra offers.

Friday, May 9, 2003

Struts is a waste of time, it takes too long to learn and too long to do anything. Stick to PHP!

David Smith
Tuesday, May 25, 2004

*  Recent Topics

*  Fog Creek Home