This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Struts Lovers, explain this. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Lovers, explain this." Watch "Struts Lovers, explain this." New topic
Author

Struts Lovers, explain this.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Working on a project where we are taking over the code base from another company. They used Struts. The struts-config.xml is 6114 lines long. How do you struts lovers justify a configuration file that large and claim that Struts simplifies anything?


GenRocket - Experts at Building Test Data
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Let me answer your question with a question:

Have you ever seen an application written entirely with JSPs where all the logic, including Database access was written in scriptlets?

I have. It's not pretty.

How, then can you say that J2EE Web technology is any good, since it can be abused so badly?

The same is true of Struts. The fact that you can abuse it doesn't make it a bad technology.

Having such a large config file is not ideal. If it were my application, I'd look at breaking it up into modules, each with it's own config file.

On the other hand, what's the big deal about it being so big? The real question is "How easily can I find the information I need about this application?"

If I as a Struts developer encounter a URL of /doThis.do, all Ineed to do is open the config file, hit <ctrl>F, search for path="/doThis" and I immediately have a wealth of information about what is going on with that URL.

I can only imagine how unwieldy such an applicaiton would be without some sort of overriding framework to keep it organized. How big would the web.xml file be if every action defined in the Struts config file were a Servlet?

You can argue that other frameworks might be better/faster/cooler/sexier. Fine. Maybe they are. If I find a better one, I'll use it. The point I'm making is that most Struts applications, with all their faults, are better and more organized for having used Struts than they would be without it.


Merrill
Consultant, Sima Solutions
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
Hi Sir,

I think in those situations where struts-config file is bocoming very large, we can break config in different modules and then each module will have its own configuration file like struts-config-A.xml, struts-config-B.xml etc.

Thanks & Regards

Naseem


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Merrill, that's pretty much the response I expected. And I even thought about deleting my post before anyone responded but I thought, what the heck. Let's see what happens.

I see every point you made. I just don't like Struts and sometimes just feel the need to voice that opinion. [ducks away quietly...]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
A 6000+ line configuration file? I wonder how long ago my project passed that mark...it is now close to the 18,000 range. Maybe that is not ideal, but it has not cause any real problems.

Several years ago I worked on several major eCommerce web sites built with Broadvision. We used presentation technology similar to JSP (I believe that Brodvision licensed LiveScript from Netscape which was the precursor to JSP). We had JSP pages that were several thousand lines long. Talk about hard to maintain!

- Brent
 
 
subject: Struts Lovers, explain this.