Slashdot Mirror


Struts Kick Start

Simon P. Chappell writes "I started learning how to use the Struts framework in late in 2001, after I became fed-up with hacking web applications together with the digital equivalent of "Duct-tape Engineering". At that time there were no books available for the budding Struts developer, "Read The Fine Manual" was not an option ... you read the website, you read the code or you asked questions on the mailing list. This situation finally changed this fall with the release of a flurry of titles dedicated to Struts. I present here my thoughts on one of the latest: "Struts Kick Start". The rest of Simon's review follows. Struts Kick Start author James Turner and Kevin Bedell pages 481 (29 page index) publisher Sams rating 9 reviewer Simon P. Chappell ISBN 0672324725 summary You need this book

What is Struts?

Struts is a framework for developing web applications. It is a distilation of the current set of known best practices into a working code set that can be extended to meet almost any web application requirements. It part of the Jakarta Project at the Apache Software Foundation.

What do I know about Struts? I have been developing web applications, using Java, for four years and using struts for over a year, and am a regular participant on the Struts mailing list. I was also a technical reviewer for one of the other Struts Books released this fall and was recently invited to speak at the University of Wisconsin, Eau Claire on the use of Struts.

What's good about this book? There are many excellent things that I could point to. I particularly like the obvious depth of research that accompanies this book. There is a very interesting history of the development of the MVC design pattern and they even name the inventor. Do you know who invented MVC? If you want to know, buy the book! The chapters cover everything that you will need to know, in the order you are most likely to need to know it. There's even a chapter explaining the "struts-config.xml" file's DTD! (You may want to skip that on the first few readings :-)

There is good coverage of the Struts taglibs. I see a lot of questions about these on the mailing lists, so this information is very timely and it looks very well explained.

I like the coverage of other open source tools that work well with Struts. This is an important point because Struts does not do everything for you (by design), so there will be areas that will benefit from other tools. I'm looking forward to trying out some of their recommendations and easing my own Struts development lifecycles.

What's not so good? Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action.

Now, I realise that example code is not the same thing as robust, production-ready code, but when people are first learning a language or framework, they tend to copy exactly what they see in the book they are learning from. Even though example code should be light on error checking, it should be heavy on correctness and good style.

Should you rush out and buy it? If you are about to use Struts on a project, are new to Struts and need dead tree documentation for those RTFM moments or are evaluating Struts for future projects, then you absolutely need this book.

If you are an intermediate Struts user, then this book would still be very useful to you and I can certainly recommend it.

If you are an experienced Struts user, then you've almost certainly exchanged emails with James or Kevin, on the Struts mailing list, so you can make your own mind up!

Table of Contents
  1. Struts in Context
  2. The Model-View-Controller Design Pattern
  3. Hello World!
  4. HTTP Protocol
  5. JSP, Taglibs and JSTL
  6. The Sample Application
  7. View Components
  8. The Controller
  9. Model Components
  10. The struts-config.xml File
  11. How the Struts Tag Libraries Work
  12. Struts HTML Tags
  13. Struts Bean Tags
  14. Struts Logic Tags
  15. The Nested and Template Struts Tag Libraries
  16. The Struts Tiles Tag Library
  17. DynaForms and the Validator
  18. Using Struts with Enterprise Java Beans
  19. Using Struts with Web Services
  20. Building, Deploying and Testing Struts Applications

You can purchase Struts Kick Start from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

134 comments

  1. Struts? by Anonymous Coward · · Score: 2, Funny

    Why learn a whole new framwork? A combination of FrontPage and MS Access will do wonders for you - MS Access will even make the VB Code for you after you use the easy drop down utilities to create macros. From there, if you really need more, it is a simple step to port it over to MS SQL Server 2000, which is much, much more enterprise scalable than PostGreSQL or MySQL.

    1. Re:Struts? by akookieone · · Score: 0, Offtopic

      please mod this down since a book review about struts has nothing to do with what database you use to develop with, especially since Struts is java based and works fine with any db that has a JDBC driver.

    2. Re:Struts? by MaxwellStreet · · Score: 3, Interesting

      hehe . . .

      Not sure if this is a troll, or intended to be funny . . . but it works on both levels I suppose.

      Anyhow, I've been using Struts for about a month refactoring a largish internal Oracle PL/SQL web app, and the MVC separation that's enforced by the Struts framework is really just what the doctor ordered. I'm getting similar functionality in roughly 20% of the comparable lines of code; and this is early enough in the project to where code reuse hasn't even come into play much. I'd imagine it'll end up at about 15% - i.e., 150K LOC using struts as opposed to about a million LOC using PL/SQL.

      I know Lines of Code isn't necessarily a good measure of just about anything - but the real benefit is maintainability and ease of expansion (which is what brought on this refactoring to begin with).

      Struts is really worth a long hard look - gets you away from using the technologies above and into a real enterprise-class web application structure.

    3. Re:Struts? by Anonymous Coward · · Score: 0

      I know Lines of Code isn't necessarily a good measure of just about anything

      Actually, studies have shown that lines of code is the metric which correlates best with effort expended (compared to uncommented lines of code, or tokens, or cyclomatic complexity, or any other code metric out there).

    4. Re:Struts? by Anonymous Coward · · Score: 0

      Reduced lines of code is an EXCELENT metric, unless your a C/Perl programmer bent on obfiscation. (in production code).

    5. Re:Struts? by Anonymous Coward · · Score: 0

      How big are your config files?

  2. Show the full respect of Struts... by mschoolbus · · Score: 1

    Without Struts, my project at work would be about 100 times more difficult than it already is.

    I think Struts has a very bright future...

    1. Re:Show the full respect of Struts... by mr.buddylee · · Score: 2, Interesting

      I personnally think Struts makes things harder. I haven't gotten into it a lot, but it seems to take me a whole lot longer to get a project done with struts than if I just used scriplet code. The only reason I use it is because I have to, I sure wouldn't us it if I had a choice. It's limiting in what you can do, and the ways you can do it, there was little to no documentation (until now I suppose), and it's just confusing. I'll admit that I'm a novice JAVA programmer, but seriously, why use a tool that makes things more difficult. It's just a tool to use until the next big thing is pushed out by a group of programmers with too much time on their hands.

    2. Re:Show the full respect of Struts... by Anonymous Coward · · Score: 0

      You've apparently not done a lot a of web programming.

      If you were, you would appreciate the framework.

    3. Re:Show the full respect of Struts... by rutledjw · · Score: 3, Insightful
      No, no, no. As you get going in Java you'll be the logic in it. As a novice programmer, it SHOULD take you a lot longer to use a tool like struts than use (whatever). You're still getting used to the syntax, flow and appropriate use of Java.

      As you get going, there becomes a more elegant technique to using teh language. Tools like struts fill the need.

      Learn what you can now and don't worry about it, the usefullness of struts will become evident as you progress.

      --

      Computer Science is Applied Philosophy
    4. Re:Show the full respect of Struts... by CorwinOfAmber · · Score: 3, Insightful
      I haven't gotten into it a lot, but it seems to take me a whole lot longer to get a project done with struts than if I just used scriplet code.

      Well of course it's going to be faster and easier (for you) to just put all of the code in scriptlets. But I sure wouldn't want to have to maintain your code. You don't separate your business logic from your display code because it's faster to develop it; you separate your code to make it easier to maintain, and more robust. Writing maintainable code is always going to be a bit more work in the short term, but it pays off over the long term.

      --
      My future's determined by Thieves, thugs, and vermin -- The Offspring
  3. MVC by jimmyCarter · · Score: 2, Funny

    That's simple man.. Al Gore invented the MVC.

    --

    -- jimmycarter
    1. Re:MVC by Malcontent · · Score: 0, Offtopic

      Al Gore did not invent the Internet but then again he never said that he did that's a republican lie that gets told over and over.

      Despite the fact that Al Gore did not invent the internet he was chanpioning it when virtually every other politician knew nothing about it. Al Gore recognized the importance of the internet very early while the rest of the dunces in congress were totally ignorant about it.

      Go ahead and do some research, I dare you. I know it will be harder then listening Bill )'Reilly and parroting what he says but you may find it educational.

      --

      War is necrophilia.

    2. Re:MVC by jimmyCarter · · Score: 1, Offtopic

      Did you happen to see my nic? And it's not just some fashionably new nic since he won the Nobel Prize.

      It's NYE and you are all trolls. ;)

      --

      -- jimmycarter
    3. Re:MVC by Anonymous Coward · · Score: 0
      "During my service in the United States Congress, I took the initiative in creating the Internet."

      - Al Gore, CNN Interview

    4. Re:MVC by ErikZ · · Score: 2


      You see, the problem is that no one cares. It's a funny story that doesn't really hurt anyone. Pointing out that it's technically wrong is like watching a movie and pointing out things that are impossible.

      It's just annoying.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    5. Re:MVC by FarkinIceHole · · Score: 1

      Al Gore didn't invent the MVC. I did!

      Al Gore's the devil.

    6. Re:MVC by Malcontent · · Score: 1, Offtopic

      How do you get from that to "I invented it"

      --

      War is necrophilia.

    7. Re:MVC by Malcontent · · Score: 2

      "It's a funny story that doesn't really hurt anyone."

      Well it probably hurts him. It also probably hurts his family. It may well have cost him the election (it was a close one after all) and as a consequence has hurt lots and lots of people. Maybe, just maybe there would be less dead people in the world if that lie was not so widely circulated.

      Even if it did not hurt anybody then it's still a lie and should be corrected whenever possible.

      --

      War is necrophilia.

    8. Re:MVC by ErikZ · · Score: 2

      And maybe we would all be dead if he was, "What if" scenerios are endless.

      I doubt it hurts his family...at all.

      It may have cost him the election? It may have gotten him votes. After all, if he invented the Internet, he must be a pretty smart guy.

      You don't like to see your canidate look stupid. That's understandable. Let me know when you start protesting when people go "George Dubya Bush".

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    9. Re:MVC by Malcontent · · Score: 2

      "I doubt it hurts his family...at all."

      And you know this how?

      "It may have cost him the election? It may have gotten him votes. After all, if he invented the Internet, he must be a pretty smart guy."

      Which scenario is more likely?

      "You don't like to see your canidate look stupid. That's understandable. Let me know when you start protesting when people go "George Dubya Bush"."

      He himself pronounces it dubya. What you want me to do correct him?

      --

      War is necrophilia.

    10. Re:MVC by ErikZ · · Score: 2

      "And you know this how?"

      The same way you know that it "Probably hurts his family." Don't apply levels of proof to me that you are not willing to apply to yourself.

      "Which scenario is more likely?"

      Nobody knows.

      "He himself pronounces it dubya. What you want me to do correct him?"

      I was going to respond to that question phonetically, but that requires too much effort and I doubt you'd get the point.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    11. Re:MVC by Malcontent · · Score: 2

      "Which scenario is more likely?"

      Nobody knows.

      ----

      Just goes to show how idiologically rigid people are incapable of coming to any conclusion which may conflict with their religious beliefs.

      The rebuclicans invented the lie and propagated it to HURT him both personally and in the election. In fact I saw John Sununu repeat that lie on tv (hardball IIRC) and follow it with the phrase "not only is Al Gore a liar he is a stupid liar".

      How can you possibly think that propagating this lie over and over by prominent republicans and the republican media had an indeterminate effect. Rush Limbaugh, Bill Oreilly, Fox TV, CNBC and the wall street journal wield incredible power, certainly enough to make a less then one percent difference in a close election.

      --

      War is necrophilia.

    12. Re:MVC by ErikZ · · Score: 2


      Or...

      Two groups of people who are ideologically opposed to each other will pick up anything that sounds true, as long as it trashes the other side.

      "Sir! Did you hear that Al Gore is claiming that he invented the internet?"
      'What? Did he?'
      "No! I was invented by the military!"
      'Ha! We got him on that one! Start running the presses!'

      "Just goes to show how ideologically rigid people are incapable of coming to any conclusion which may conflict with their religious beliefs."

      Ok, now you're just trolling. What does a person's religious beliefs have to do with this?

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    13. Re:MVC by Malcontent · · Score: 2

      "Two groups of people who are ideologically opposed to each other will pick up anything that sounds true, as long as it trashes the other side."

      I don't dispute this. What I dispute is your contention that continually lying to the public by the republican party about what Al Gore said has either

      a) Had no effect on the election
      b) Had a beneficial effect for Al Gore in the election.

      You claimed both of these because you can not admit that a continual repeating of this lie could have made a difference in the outcome of the election (and therefore making profound difference in the world).

      Not only that but you are incapable of admitting that lying about somebody is probably hurtful to them and their family.

      Because of the rigidity introduced into your thinking process by strict adherence to an idiology your mind is incapable of coming to conclusions which may cause dissonance with that idology or point out that the idiology (and the idiological leaders) may end up using sleazy means to achieve their ends.

      You insist that that it was a "harmless lie" and that it did not "hurt anybody". Any logical person would have to conclude that it was not a harmless lie because in a close election there is a high probability that it had an effect on the election and that it not only hurt Gore family but because of it's effect on the election it hurt all democrats.

      Of course I can't see a Gore presidency being so indefferent to the plight of the palestenians and declaring a war on Iraq so you could theoretically add the upcoming deaths of tens of thousands of iraquis to the list of people hurt by that "harmless lie".

      --

      War is necrophilia.

    14. Re:MVC by ErikZ · · Score: 2

      "You claimed both of these because you can not admit that a continual repeating of this lie could have made a difference in the outcome of the election (and therefore making profound difference in the world)."

      Actually, I can't believe that the continual repeating of a stupid joke would make a difference in the outcome of an election. Considering that Gore didn't do anything to make sure that voting machine fiasco didn't happen again, makes me think that he didn't care either.

      "Not only that but you are incapable of admitting that lying about somebody is probably hurtful to them and their family."

      Lies are part of politics. If this one stupid joke wreaks havoc on the Gore family, then they're dead meat when the professional lies and spin comes along.

      "You insist that that it was a "harmless lie" and that it did not "hurt anybody". Any logical person would have to conclude that it was not a harmless lie because in a close election there is a high probability that it had an effect on the election and that it not only hurt Gore family but because of it's effect on the election it hurt all democrats."

      Any logical person would like a bit more proof than "You think it sounds right." Normally, I'd be happy to chew on that concept with you. Except that when I put forth my theory, you suddenly wanted proof. So fine, if you want to be like that, bring me proof that it had an effect on the election. You have NO IDEA what people use as a criteria for voting, and giving the impression that you know what they do is a lie.

      "Of course I can't see a Gore presidency being so indifferent to the plight of the Palestinians and declaring a war on Iraq so you could theoretically add the upcoming deaths of tens of thousands of iraquis to the list of people hurt by that "harmless lie"."

      The Palestinians have been in this "Plight" for how long? 30 years? And despite the constant aid from many western nations and the UN, they have barely improved. Maybe trying something different, like Bush is doing, is the key to fixing the problems. You're right though, Gore probably would of continued to push the same policies that don't work, causing no improvement in the situation. What bold leadership!

      As to the "Tens of Thousands" that will die in Iraq from the future attack. Is that the total, or the people that Sadamm takes down with him as he invades? It's probably just a rumor that he's been planting chemical bombs in his own cities for the US invasion. After all, he wouldn't kill his own people, would he?

      But I'm glad you're here to stick up for Tyranny. That no matter how bad other people have it, or how much our interests are threatened, you're here to let us know that we shouldn't do anything to solve it, if it involves people dying.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
    15. Re:MVC by Malcontent · · Score: 2

      "Actually, I can't believe that the continual repeating of a stupid joke would make a difference in the outcome of an election."

      Once again this is due to your idioogical inflexibility. The race was decided by a few hundred votes. It is reasonably probable that repeatedly lying about Al Gore would have influenced a few hundred people (which represents a minute percentage of the voting population).

      "Considering that Gore didn't do anything to make sure that voting machine fiasco didn't happen again, makes me think that he didn't care either."

      He had no power to effect any change. If he had become the president then he would have had the power to do somthing about it. As a private citizen there was very little he could do. There was a class action suit in florida about denying black people the vote by wiping them off the rolls as felons and florida paid a bunch of money to a bunch of folks. As far as I know that was only real consequence for rigging the election.

      "Lies are part of politics. If this one stupid joke wreaks havoc on the Gore family, then they're dead meat when the professional lies and spin comes along."

      I did not say that it "wreaked havoc" I only said that it hurt them. Again your idiological inflexilibity prevents you from admitting what most people understand very well. Telling lies about people hurts them, making fun of people hurts them. Maybe like you say it's OK to hurt people a little or maybe it's OK to hurt Al Gore a little, maybe it's ok to hurt people as much as possible but not enough to "wreak havoc" with them. I really don't know where you are coming from in this regard. Even if you think it's OK to hurt Al Gore by lying about it (despite what the ten commandments says about bearing false witness) at least admit that it did most probably did hurt him.

      "The Palestinians have been in this "Plight" for how long? 30 years? And despite the constant aid from many western nations and the UN, they have barely improved. Maybe trying something different, like Bush is doing, is the key to fixing the problems."

      Well I don't want to get into a detail discussion about the plight of the palestenians here but I don't think anybody would agree that they are better off under a bush presidency then they were under any other administration. You are right for the last 30 years they have been suffering miserably under a military occupation by Israel but only in the last couple of years has that been compounded by widespread malnutrition and starvation.

      "You're right though, Gore probably would of continued to push the same policies that don't work, causing no improvement in the situation. What bold leadership!"

      IT might not have improved the situation but then again I bet most palestenians would have prefered their previous miserable conditions to their present event more miserable conditions. Sometimes staying where you are is better then losing ground.

      "As to the "Tens of Thousands" that will die in Iraq from the future attack. Is that the total, or the people that Sadamm takes down with him as he invades?"

      I am only counting the deaths that will be caused by our own bombing. Last time we attacked them we killed over 50,000 people and of course more died as a result of our destruction of crucial infrastructure such as electricy generation facilities, water treatment plants, roads and bridges and such. We also killed something like 30,000 people in afghanistan. I am presuming that we will kill at least 10,000 people in Iraq which is a very conservative estimate. Saddam might also kill some people while retreating or as a scortched earth last defense type of situation. Either way it's totally unnecessary. If we decided not to invade both types of deaths could be avoided. This war with iraq is very avoidable.

      "It's probably just a rumor that he's been planting chemical bombs in his own cities for the US invasion. After all, he wouldn't kill his own people, would he?"

      If we did not invade then he would have no need to deploy those weapons.

      "But I'm glad you're here to stick up for Tyranny."

      I am doing no such thing. Try another line of attack if you want to. Lying is not an effective argument method. You can not simply try to demonize whoever you are arguing with and make yourself right. The truth does not work that way.

      "That no matter how bad other people have it, or how much our interests are threatened, you're here to let us know that we shouldn't do anything to solve it, if it involves people dying."

      What a fine sentiment except that it's a non sequitor. We have no interests there except oil and I for one believe that's it's wrong to kill people and take their stuff even if that stuff is oil. You apparently also think the only way to solve whatever problem you perceive is by killing lots of iraquis and militarily occupying their country. I for one believe that there are many many other options. Any solution to whatever problem you perceive has to make the situation better for the people who "have it bad".

      State the problem, consider the available options and choose the one with causes the least amount of harm. So far I have not even heard what the problem actually is.

      If it is weapons of mass destruction then we should deal with it like we deal with other countries that have weapons of mass destruction.

      If the iraqui people are suffering (and they are) then let's try to help them.

      I have also heard people point out that Saddam has killed his own people (well they were kurds and he does not view them as his own people but that's beside the point). The fact is however that the US govt had no objection to that when it happened and it's a bit silly to have any objection to it now that's too late. In fact we gave him the knowhow and the technology to do that in the first place. What he did was evil and it should have been dealt with then.

      --

      War is necrophilia.

    16. Re:MVC by ErikZ · · Score: 2

      "Once again this is due to your ideological inflexibility."

      Out of curiosity, what brand of ideology do I subscribe to? I'm just curious as to where you've pigeonholed me.

      "He had no power to effect any change. If he had become the president then he would have had the power to do something about it. As a private citizen there was very little he could do."

      Interesting. I was told that when Nixon lost the presidential election to Kennedy in Chicago due to voter fraud, he was furious. And then he fixed the system so it couldn't happen again. So, either I was lied to or you're wrong.

      "Telling lies about people hurts them; making fun of people hurts them."

      You ate 38 jelly beans for breakfast.
      Your momma is so fat; when she ran away she took up all four sides of the milk carton.
      Bill Clinton dyed his hair bright purple and joined a heavy metal band.

      All three statements above are a lie. Are you hurt? Is your mother hurt? Is Bill Clinton hurt?

      No.

      "Well I don't want to get into a detail discussion about the plight of the Palestinians here..."

      Seriously? Then don't bring up such a hot topic. It forces me to address it with a rebuttal. Otherwise it looks like I'm conceding your point.

      "
      I am only counting the deaths that will be caused by our own bombing. Last time we attacked them we killed over 50,000 people and of course more died as a result of our destruction of crucial infrastructure such as electric generation facilities, water treatment plants, roads and bridges and such. We also killed something like 30,000 people in Afghanistan. I am presuming that we will kill at least 10,000 people in Iraq which is a very conservative estimate. "

      I've had a VERY hard time getting consistent numbers about the gulf war. Civilian deaths have gone from 30k a WEEK during the war to less than a thousand for the whole war. But I find it hard to believe that we directly bombed civilians to the tune of 30k deaths. The sheer amount of effort and ammo required to kill that many people would not go unnoticed.

      "If we did not invade then he would have no need to deploy those weapons."

      And this is the most ridiculous statement you've made so far. Not even Hitler came up with the idea of killing his own people as a deterrent against invasion. It's monstrous if true and would be reason enough to depose the rulers of Iraq.

      At what point do you think it's appropriate to invade another country?

      "I am doing no such thing. Try another line of attack if you want to. Lying is not an effective argument method."

      Excuse me? Your agreements show that you don't believe in invading Iraq. Currently Iraq is ruled by a cruel dictator. There is only ONE way to improve that country and it's to remove it by force. Any argument to the contrary, even "Well, if Al Gore was president, we wouldn't be invading." is saying that you prefer Sadamm to be in power. Sounds like sticking up for tyranny to me.

      "We have no interests there except oil and I for one believe that's it's wrong to kill people and take their stuff even if that stuff is oil."

      Lying is not an effective argument method.

      "State the problem, consider the available options and choose the one with causes the least amount of harm. So far I have not even heard what the problem actually is."

      Seriously? We've fought a war, committed sanctions, and conducted inspections, and enforced no-fly zones and you STILL don't know what the problem is? A big help is to imagine yourself as the leader of the U.S. and withdrawing from Iraq without doing anything. Imagine the ramifications.

      "The fact is however that the US govt had no objection to that when it happened and it's a bit silly to have any objection to it now that's too late."

      Er, the US didn't have a problem with that. You are who has the problem with civilian causalities(From the Gulf War). And when I pointed out that Sadamm is willing to kill his own people, you switch to the line of argument "Well; now the US can't say anything about Sadamm killing his own people because they didn't say anything when it happened before. And now it's too late."

      So, back to where we started from. Gore didn't invent the internet, but it's a cute joke. You say it effected the elections in Florida. I say that the amount of people who voted for Bush because of this, were canceled out by the people who voted for Gore because they liked the color of his tie.

      How many people stayed home and didn't go out and vote because they heard that the exit polls on the news telling them that Gore won? I must admit, I wish they did the whole thing over again. The margin of victory was too small for me.

      --
      Democrats or Republicans. They are both taking us to the same place and they are not afraid of us anymore.
  4. Little nitpick by FortKnox · · Score: 4, Informative

    What is Struts?
    Struts is a framework for developing web applications. It is a distilation of the current set of known best practices into a working code set that can be extended to meet almost any web application requirements. It part of the Jakarta Project at the Apache Software Foundation.


    Struts is a Java/J2EE based framework. Although you could change it to use with other languages, it has taglibs and other features that are pretty much Java only.

    Why such an influx of Struts books? Its becoming quite the standard in the Java/JSP+servlet world. J2EE developers are still being hired (hear that unemployed CS people?), and have been strong through the IT drought, and Struts experience is an even bigger plus.

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:Little nitpick by ideonode · · Score: 1

      Its becoming quite the standard in the Java/JSP+servlet world

      Indeed. Another factor in the championing of structs is its featuring in the toolsets of products like BEA (yes, some may see BEA as a stinking pile of bloatware, but it is rather respected by many enterprise players).

    2. Re:Little nitpick by GiorgioG · · Score: 1

      J2EE developers are still being hired (hear that unemployed CS people?)...

      You're making a fairly large assumption aren't you? - that they're being hired only because they know J2EE technology. I think not. J2EE developers are usually experienced (if not 'software architects' - whatever that means) and that's why they are still being hired. Anyone with 3+ years experience can find a job fairly easily.

    3. Re:Little nitpick by bataras · · Score: 2, Informative

      Struts is NOT J2EE based. it's plain vanilla JSP/Servlets based

    4. Re:Little nitpick by Carbonite · · Score: 1, Offtopic

      Anyone with 3+ years experience can find a job fairly easily

      Speaking of fairly large assumptions...

      --
      ich muß mehr Kuhglocke haben
    5. Re:Little nitpick by Anonymous Coward · · Score: 1, Informative

      JSP/Servlets are a part of J2EE.
      J2EE = JSP, Servlets, EJB (not just EJB).

    6. Re:Little nitpick by CaptainCap · · Score: 1

      Perhaps excluding those who are over-qualified (3.5+ years experience)

    7. Re:Little nitpick by mark_lybarger · · Score: 1

      one container,
      two containers,
      three containers,
      four.

      sure, it will work in the JSP/Servelet container only, but it also works nicely if you're using an EJB container as well.

      the main point about struts is that it's a JSP based Model View Controler framework. actions and all that. Turbine/Velocity is another MVC framework that can be usefull if you're using one or two, or three containers. No books that I can see on the latter that i've seen, anyone interested in throwing one together?

    8. Re:Little nitpick by rutledjw · · Score: 2
      I wouldn't call it easy, but Denver has been it hard. Having 3+ years and knowing what the f*ck you're talking about in an interview does help out.

      I point out the latter as I've interviewed a LOT of people and I've seen lots of great resumes with Java exp and owners of those resumes who look at you blankly when you ask any degree of difficult question...

      --

      Computer Science is Applied Philosophy
    9. Re:Little nitpick by KwisatzHaderach · · Score: 1

      Mod the Coward up and bataras down. He seems to be assuming that J2EE == EJB.

      Servlets are just as much a part of the specification.

  5. No idea what it does by dnoyeb · · Score: 3, Insightful

    I still have NO IDEA what struts does. the struts website is not helpful in a brief overview. Saying it helps develop web applications is a joke. What does it replace because I can develop web apps without struts.

    Should I be using it? Im too unknowledgeable to even know what question to ask. I use EJB, and I have a webapp. I'm just baffled.

    1. Re:No idea what it does by Anonymous Coward · · Score: 1, Funny

      Struts is a framework for people who like frameworks.

    2. Re:No idea what it does by revscat · · Score: 3, Informative

      Struts is an MVC-based framework for developing web apps. It helps to separate out the different layers of your application. You could use it with EJBs, if you wish, because it is mostly a means for separating out your business logic from your presentation.

      Asking "should I be using it?" is difficult to answer, because it depends upon your requirements. But if you are developing a web application that requires a quick turnaround time and is easy to maintain, Struts will help you along.

    3. Re:No idea what it does by Anonymous Coward · · Score: 0

      Struts is a framework that forces you to use the Model-View-Controller pattern.

      Best way to explain it is to download it with tomcat, install it (it takes like 3 steps to get a sample struts app into tomcat), and play around with it.
      Struts seperates everything out, has its own taglibs, and turns all your JSP's into actions.
      If you know your MVC pattern, struts takes care of almost all the Controller part, leaving you much less to do.

    4. Re:No idea what it does by Boss,+Pointy+Haired · · Score: 5, Funny

      It replaces the tedium of having to write your own form handlers, IO verification and output generation with the tedium of having to learn Struts.

    5. Re:No idea what it does by Malcontent · · Score: 2

      Oh man that's funny as hell.

      --

      War is necrophilia.

    6. Re:No idea what it does by ChristTrekker · · Score: 1

      I thought we already had MVC with JSP/servlet/EJB. How does Struts change this? From what I can tell it's some sort of framework that handles form data validation. That's always rather tedious, so if Struts saves time it's a good deal.

    7. Re:No idea what it does by mark_lybarger · · Score: 1

      i've looked over their site a few times too, and never really got what struts did either. "it's good if you've got a site with lots of forms" someone told me once. i had some time recently working with Turbine/velocity (implementing, the docs on the site are about the same) and now it kinda makes some sense.

      if there's any bored document writers out there... jakarta and apache really need your donations! any corporations needing an extra tax write off? please donate a doc-writer to these projects.

    8. Re:No idea what it does by revscat · · Score: 3, Informative

      I thought we already had MVC with JSP/servlet/EJB. How does Struts change this? From what I can tell it's some sort of framework that handles form data validation. That's always rather tedious, so if Struts saves time it's a good deal.

      Mmmm.... Part of Struts is validation, although technically it is a separate component. (See the Jakarta Commons Validator) This is a minor (though extremely useful) part of it, however.

      What makes Struts what it is are (arguably) ActionForms (basically, JavaBeans with some enhanced functionality) and ActionForwards/ActionMappings. These allow you to separate out the logic which operates upon data which will eventually be diplayed from the actual display of that data. Because solutions which depend upon JSPs tend to become a mass of unreusable scriplets, having this separation allows for a more maintainable site and avoids the pitfalls which have traditionally plagued JSPs.

    9. Re:No idea what it does by ChristTrekker · · Score: 1
      Because solutions which depend upon JSPs tend to become a mass of unreusable scriplets, having this separation allows for a more maintainable site and avoids the pitfalls which have traditionally plagued JSPs.

      I suppose I'd "get it" better if I'd done more JSP development than I have. I guess I'm lacking the context to see how useful this is. I'm hoping to do write a small web tool for myself soon though, so I will read up on this and see if it clicks.

    10. Re:No idea what it does by rutledjw · · Score: 2
      Yeah, but it's a framework you fool! Is it possible to develop without a framework/methodology/pattern/architecture/tool?!?

      Mmmm, kool-aid...

      --

      Computer Science is Applied Philosophy
    11. Re:No idea what it does by autopr0n · · Score: 2

      if there's any bored document writers out there... jakarta and apache really need your donations! any corporations needing an extra tax write off? please donate a doc-writer to these projects.

      I KNOW! Apache seems to make so much usefull stuff, but they never explain what it does! I like nice names as much as the next guy, but apache has so many projects it would really be helpfull if they picked more descriptive ones, I.E. "Apache JSP/Servlet server" rather then "Apache Tomcat".

      --
      autopr0n is like, down and stuff.
    12. Re:No idea what it does by Anonymous Coward · · Score: 0

      "It replaces the tedium of having to write your own form handlers, IO verification and output generation with the tedium of having to learn Struts."

      It's times like these that I wish there was a special moderation point of 6 for the truly great posts. It's one of those "funny, but probably very true" things.

      On a serious note, I've (as I'm sure many others have) often wondered this exact thing when presented with a new helpful framework or tool (or whatever).

  6. Struts is great, but... by General_Corto · · Score: 4, Informative


    I've been working on a reasonably sized project for some time now (still undercover, so can't go into details)... I'd been looking for a good framework to use, and Struts looked like it fitted the bill.



    Until I started dealing with the display (view) side of things.


    Getting to grips with the Action and ActionForm stuff is simple, and I think that anyone could do it. However, because they expect you to use all the usual standard stuff (taglibs, etc), building new taglibs and dealing with that was going to be a nightmare.


    Also, the HTML taglib, when told to output XHTML only, doesn't work. tags like the BASE tag aren't closed properly.



    Fortunately, I'd been looking at using Tea earlier on (Jason Hunter uses it at servlets.com). Someone on the tea mailing list posted a link to a very useful article on using Struts for the backend of a web app and Tea for the front end. You can find it here:



    http://www-106.ibm.com/developerworks/library/wa-t ea1/

    http://www-106.ibm.com/developerworks/library/wa-t ea2/


    1. Re:Struts is great, but... by MaxwellStreet · · Score: 5, Informative

      Velocity is another jakarta project that helps out on the view side of things. You might want to check it out . . .

    2. Re:Struts is great, but... by Anonymous Coward · · Score: 0

      try cocoon, simalar concept, allows you to use xsl to produce the view.
      http://xml.apache.org/cocoon/index.html

    3. Re:Struts is great, but... by Julian+Morrison · · Score: 1

      JSP: overkill, mangle code into HTML and vice versa.

      Webmacro: bloody unreadable.

      Tea: vastly overkill, a whole new language.

      XMLC: overkill in most cases, who wants to have to manipulate the DOM of a parsed page to set a few template variables?

      Velocity: plenty good, but it isn't that portable, and it stll looks kinda ugly. All those ### make it impossible to edit templates in GUI webpage editors.

      XSLT: ouch!

      HTML template hits the spot. Simple, no business logic mangled into the page, can be XML-ly correct, and it's even portable between perl and java.

  7. java server faces by rhyd · · Score: 2, Insightful

    i thought these were going to replace struts sometime soon...

    --
    'Be the change you want to see in the world' - Al Gore
    1. Re:java server faces by Brummund · · Score: 1
      I hope JSF is successful. I mainly work with J2EE, and I'm quite happy with most of the framework. However, I'm not that fond of JSP and equivalents.


      This year, I had to do some .NET-projects, and the flexibility of ASP.NET (I've done a lot of ASP programming, but I generally hate it) impressed me. Using thirdparty controllers is a breeze. Need a flexible HTML editor on your web page? Download and plug it in. Need a component for displaying nice calendars etc? Download and plug it in. The code behind features are also nice, providing a rather easy way of implementing events, while still getting to compile it. (I hate having to check for type errors etc. in code by reloading a web page, like in ASP)


      That to say, ASP.NET is (IMHO) quite similar to Struts, only with stronger commercial support.


      As for the rest of .NET, I like "the J2EE way " better than .NET. The .NET development environment using vs.net is OK as long as it works. We've had a lot of strange problems with different hosting providers and/or VS. And Microsoft, FOR THE LOVE OF GOD, get rid of frontpage server extensions and replace it with something more maintable. It is2003 (soon :-)!

      (And building j2ee projects with ant rocks.)


      Somtimes we've just had to reboot the server and rebuild the project, and it would work. (I guess there are some problems regarding assemblies, but we haven't figured it out). And if someone has uploaded a new build of the system on IIS, and another developer starts up VS.NET, and VS.NET contains an older build in the cache, we have to refresh the project and rebuild. Beats me. It could be the server, but there is no fscking way of finding out. And that is another thing I like with J2EE: The application server is not that closely integrated with the OS, and more easily debugged. Yes, sometimes I have to restart WL or JBoss, but I don't have to reboot the server "just to be sure"

    2. Re:java server faces by Brummund · · Score: 1
      (And building j2ee projects with ant rocks.)


      I forgot to mention Emacs and JDEE. :-)

      Setting up JDEE to get all the features can be somewhat intimidating, but worth it. You'll get features like intelligent code completition, easy lookup in the jdk or your own documentation, integration with ant (jdee can parse build.xml and provide completition on build targets etc.) etc. For modelling, I'm trying out Poseidon UML, which is, AFAIK, based on ArgoUML. (And it is a java app, so it runs on Linux, which I use on my workstation)

  8. Not quite tired yet.... by revscat · · Score: 0, Offtopic

    Maybe if we trot out the ol' "Al Gore invented X" meme for a few more years it might get tired, but it sure isn't yet. Hey! I have an idea! Maybe we can even COMBINE CLICHES!

    1. Have Al Gore invent the internet
    2. ???
    3. Profit!

    Hahahaha. I'm so clever. And let me just take a moment to make a joke about cigars and interns. And maybe even drop some comment about Vincent Foster, if I'm feeling really bona fide. MMMMMhmm.

    1. Re:Not quite tired yet.... by volsung · · Score: 1

      IN SOVIET RUSSIA, Internet invents Al Gore!

  9. was the Struts Kick Start site built with Struts? by Anonymous Coward · · Score: 0

    Someone there doesn't know how to use it then. The first XML RSS link points to localhost:5335.

  10. What the big deal with Struts... by Anonymous Coward · · Score: 1, Interesting

    Don't get me wrong, Struts is great and I am currently using it in my applications... But, I have to ask, what the big friggin' deal with struts - why all the hype...

    Strust is just an implementation of what has already been developed by several companies - I will use Apple as an example. The same sort of thing is done with WebObjects in that the HTML from end and back end Java (or Obj-C) is linked with the need to create any real glue to connect them - it just sort of does it for you - with a nice IDE I might add.

    WebObjects (like Struts) allows a developer to connect front end HTML to a server and pass data back and forth so that it's easier to deal with on the server...

    Okay so why the rant? Well do you really hear about WebObjects being used all that much, NO! The reason (outside of the fact that when it was a NeXT product it use to cost a forture) it that the learning curve is wicked steep. That is where I see Strust going, it's a great technology, can do all sorts of cool stuff, will ease development but requires some time to get ones head around how it works.

    I have seen more than a few projects that claim they use Strust when in fact they use maybe 5% of Strust and still need to use code to glue the front and middle tiers together. It's a real shame that we do not have really nice editor integration - ya ya, I know a few editors have the integration but face it folks, they all suck.

    What we need is one of the big guns to step up to the plate and really integrate (and support) struts integration *wink wink* Borland...

    Just my .02

    1. Re:What the big deal with Struts... by TapestryDude · · Score: 1
      I just can't resist plugging Tapestry, which follows the concepts of WebObjects but runs with it ... and is open source.

      Tapestry has a great plugin for Eclipse called "Spindle".

      The learning curve can be a bit steep, but not as steep as Struts in many ways (I use Struts at my current job, and it was a massive pain for me to shift gears and work within the limitations of Struts).

      Meanwhile we're changing the framework and improving the documentation to make Tapestry the easiest to use web framework out there.

      --
      Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
    2. Re:What the big deal with Struts... by richieb · · Score: 2
      The learning curve can be a bit steep, but not as steep as Struts in many ways (I use Struts at my current job, and it was a massive pain for me to shift gears and work within the limitations of Struts).

      So how about a quick comparison of Tapestry and Struts? What's easy to do with Tapestry that's hard with Struts?

      --
      ...richie - It is a good day to code.
  11. Not for a while by revscat · · Score: 3, Informative

    JSF could replace Struts one day, but not for a few years at the least. JSF is still in the early phases, whereas Struts has had several years to mature. I would definately keep an eye on JSF, but wouldn't recommend using it on non-experimental sites for a while.

    1. Re:Not for a while by dffuller · · Score: 1

      Interestingly enough, Craig McClanahan is both the lead on the Struts project and is also the spec writer for JSF (Java Server Faces). I think it will be interesting to see what results from this.

    2. Re:Not for a while by rhyd · · Score: 1

      advice here said if you're starting a completely new application which is expected to last a while you should be writing to JSF now:

      "If you have existing Struts-based applications that use the existing HTML tag library, feel free to continue to use them if you wish. Struts 1.1 offers full support for this existing functionality.

      Once the integration library becomes available, you should do some experimenting and prototyping to determine the effort required to migrate your apps to the new JSF component architecture (I'm betting that the extra functionality you gain by doing this will be well worth the effort in many cases). As described above, the actual migration can be done piecemeal -- it doesn't need to happen all at once.

      For applications now (or about to be) under development that have relatively short term schedules (i.e. the next few months), you should probably stick with the existing HTML library.

      For applications with a longer lead time, seriously consider waiting for the ability to use JSF components instead of the Struts HTML tag library. Doing this will let you leverage not only the standard HTML components that come with JSF out of the box, but also the rich libraries of JSF components likely to be created by third parties in the future (including Struts developers)."


      --
      'Be the change you want to see in the world' - Al Gore
  12. NOT a fix all by Anonymous Coward · · Score: 0

    I like struts and think it is a good step forward, but I have to nit pick. MVC works great in environment where the business logic and functional requirements rarely change. In an environment where requirements change daily and weekly, MVC is a burden on the developers. In those cases a page centric approach is more desireable. If for example your site uses lots of banners and that logic changes rapidly, having it in bean makes life harder than it should. Some one is going to argue, "you didn't do a good enough job generalising it." Sometimes that is a luxury you don't have. How many people have worked in shops where there were no written requirements and requests for changes and new feature are sent every day. Struts borrows some ideas from swing and awt. If your sitaution is one that has an established development process with rigorous requirements stage, then struts should work. If not, look else where.

    1. Re:NOT a fix all by Anonymous Coward · · Score: 0

      If your business logic and functional requirements change daily (what in THE hell do you do?), then you need to get a rules engine. They are a fortune, and the cost is enormous, but it abstracts the business logic out so you can maintain constant change. Its what major financial and business sites use.

      BTW - you can attach struts to a rules engine. But it was a good troll (I bit)

    2. Re:NOT a fix all by Anonymous Coward · · Score: 0

      The first poster is correct that separate logics will burn almost everyone when things get complex. Now you say "a rules engine" and leave it at that. Now THAT is a troll.

    3. Re:NOT a fix all by Anonymous Coward · · Score: 0

      I guess you've never worked in a startup. I've had similar experiences in startups where CEO's, CTO's and PM all ask for new features or change features day to day. Of course the solution to that problem is find a new job where development follows a process. It's java right, so obviously you can hook any number of Java expert system shells to it. If the managers can't make up their mind what features they want, you think they will fork out money for a rules engine :) One could say those situations are hopeless to begin with, but in these times you have to make a living.

  13. ok folks by Anonymous Coward · · Score: 2, Insightful

    say it with me now ...

    "web-work is monkey-work"
    "web-work is not amazing"
    "web-work takes a pea sized brain"

    i should know - i do web work. because it pays.
    because some bunch of fools decided to pay me for
    it does not make it clever. because some bunch of
    fools decided to pay You for it definitely doesn't
    make it clever. step back and look at what you
    do and then tell yourself there is anything
    remotely complex in there. there isn't. its
    crap. its not scottish its crap. quit selling
    me books about crap. quit pushing your crap on
    everyone else. crap crap crap crap crap.

    1. Re:ok folks by Anonymous Coward · · Score: 0

      ummmm... are you talking about writing HTML pages or real applications?

    2. Re:ok folks by fraxas · · Score: 2, Insightful
      The majority of web-work -- as you put it -- is crap.

      Lucky for us, most of web application development isn't web work -- it's application development. So we're not so crapful after all.

    3. Re:ok folks by Anonymous Coward · · Score: 0

      'web applications'. right.

      any monkey could do it, and many monkeys do.

      the dot-com burst was music to me, because 99%
      of you jobless fruitcake 'web developers' can now
      go back to flipping burgers, or whatever you were
      qualified to do, if you aren't sitting around
      your parent's houses looking around for another
      do-nothing job for know-nothings.

      good bloody riddance.

  14. Who/what is Start... by Anonymous Coward · · Score: 0

    ...and why is Strut kicking it? In other words, why would I even look at a book that can't even get its title right?

  15. Struts is GARBAGE by Anonymous Coward · · Score: 0

    It's a overhyped, overcomplicated, manager-type
    buzzword compliant "API/framework". It's the
    (a)moral equivalent of a 1000 line C++ program
    to print "hello world". Those who "get" dynamic
    web page creation - don't use struts. It's
    a runaway buzzword train and it's a good way
    to seperate the wheat from the chaff - if
    someone claims to be a "struts programmer", pray
    that your competition hires him

    1. Re:Struts is GARBAGE by Lysol · · Score: 4, Informative

      Not true at all. I've been following Struts for a *long* time and depending on the project it can make a huge difference. Sure, you can code page to page, embed the logic wherever and move on your merry way. But adverse things will definitely start to happen when:

      1. you are no longer 'the man' and the mgmt rolls in the html guy(s)/gal(s). most html people can deal with <xml style markup> than <%java scriptlet%> stlye <%blocks%> (i won't even get into logic flow in scriptlet blocks). separation of presentation logic from biz logic; speaks for itself. and it's possible with scripting languages, but tough.

      2. you want to extend the app. 'oh, but marketing want's to have their server also come in on that url that you did last year'. true, you could accomplish extension well with scripting language, but the delegation with struts/MVC us much cleaner and more maintainable.

      3. you want to debug/qa. struts is tested and kid approved. i'm going thru something right now where our system has bugs and no one really knows cuz different people have worked on each others code and did everything differently. and even on a huge project in the past i had done, it was still hard for me to figure out flows and such when they were scripted from page to page. a unified framework helps resolve those differences in coding and thusly, easier to debug.

      And I'm sure there's even more things that I haven't listed. One issue to really consider is do you want a page to page thing - which is good for proof of concept, quick and dirty. Or do you want something you can live with for the next year or so? Using a framework like struts will make your long term much easier.

      For the biggest project I worked on, a major airline portal, we rolled our own MVC framework. This was prior to struts and yet in the end, the code was very similar. Their system runs on over 100 Sun CPUs and has been cranking away since they launched a few years back, without a major crash or anything.

      This stuff does work and the bigger the project, the better. It's a little tough to get in the beginning, but after you implement it, you start to see that it makes sense. I feel tho, it's definitely more of an 'enterprise' thing than a small 20 page site; altho, u could use it for a small site if you wanted, no problem.

  16. MVC... by blamanj · · Score: 2

    ...or model/view/controller, was invented by Trygve Reenskaug, and first appeared in Smalltalk at Xerox Parc.

  17. Re:Car parts? by Real+World+Stuff · · Score: 0, Troll

    Ok, might be a troll but I'll bite.

    Gluh glug...glub.

    Rooty poot!

    --
    If we don't fight for ourselves no one will.
  18. Is it just me...? by Malic · · Score: 3, Insightful

    ...or is it that Struts, JavaServer Faces and MVC methodologies merely enforce good coding techniques/styles that one should be using anyway? Regardless of if you are using PHP, Perl, etc.

    Or is there something more here?

    Sometimes I think Java, OO and other development technologies are like grammer school teachers hovering over our heads saying, "Now, we *know* you are going to be sloppy if left on your own, so are going box you in so that you CAN'T do those sloppy things."

    Except that you still can. VERY easy to understand and maintain applications can be coding procedual languages. VERY difficult to understand and maintain applications can be written in OO languages.

    But I digress... by nature.

    --
    I swear by MacOS X. Although I use to swear *at* MacOS 9...
    1. Re:Is it just me...? by mark_lybarger · · Score: 1

      um sure, it could be used in other areas of software development too, but is there a framework (class libraries and examples/description of how to use them) available?

      MVC is an abstract concept, struts is one implementation. Is there an implementation for Perl? maybe those GNU folks need to get started on their own MVC implementation. Afterall, they don't seem to like any implementation they can't kontrol ;).

    2. Re:Is it just me...? by revscat · · Score: 2

      ...or is it that Struts, JavaServer Faces and MVC methodologies merely enforce good coding techniques/styles that one should be using anyway? Regardless of if you are using PHP, Perl, etc.

      Yes. That is indeed largely their purpose. I don't see how that's a bad thing given that you almost always develop with people who have varying degrees of discipline when it comes to sticking with good coding practices. Some (like me, honestly) are damn near fanatical when it comes to sticking to plan. Others don't care as much, so long as the job gets done.

      Sometimes I think Java, OO and other development technologies are like grammer school teachers hovering over our heads saying, "Now, we *know* you are going to be sloppy if left on your own, so are going box you in so that you CAN'T do those sloppy things." Except that you still can. VERY easy to understand and maintain applications can be coding procedual languages. VERY difficult to understand and maintain applications can be written in OO languages.

      I think that both cases depend upon the quality of the code(r), and what you personally prefer. I tend to find OO solutions more elegant and easier to maintain, whereas it has been my experience that with functional languages it is dangerously easy to wind up with an unmaintainable and barely understandable mass of spaghetti code. This is especially true whenever time begins to run out and deadlines approach: people freak out and start slapping out code that they would normally be embarrased about. Having a structure like Struts in place helps to keep this from happening.

      This is not to say, of course, that people don't make classes that are nothing more than a series of

      public static final
      methods, and that wind up behaving exactly like the procedural languages. In any language worth it's salt it will be possible to code both well and badly.
    3. Re:Is it just me...? by deaconBlue · · Score: 1

      1. MVC is, definitionally, a pattern of good coding style/technique. That doesn't mean that great programmers should intuit MVC, though they might, but now at least we 'know it when we see it.' It's got a proven track-record and kids should get a dose of it in school.

      2. Traditional CGI programming, little scripts here and there making web-pages, is REALLY REALLY exhausting to make MVC. It is definitely possible, but Cocoon and Struts make it MUCH easier.

      3. Finally, one sentiment that keeps coming up is: ok, so I trade doing it 'well' the old way and working my butt-off OR I work my butt-off learning the frawework to do it the new way. I think this is mistaken. My experience is that when good programmers encounter good frameworks, they can intuit their way around fairly quickly.

      Personally, Cocoon and Struts were like a cold drink of water and made me feel less alone in the desert.

    4. Re:Is it just me...? by Anonymous Coward · · Score: 0

      ...whereas it has been my experience that with functional languages it is dangerously easy to wind up with an unmaintainable and barely understandable mass of spaghetti code...

      Either you haven't really programmed with functional languages or this is some brainfart and you meant imperative...

  19. What's not so good? by Brummund · · Score: 3, Interesting
    Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action.



    Hm. I'm not quite sure I follow you here. I haven't read the book, only your review, and I'm a bit puzzled by your statement regarding business objects in actions.


    Is it so that the example code for the actions contain business logic directly, or do they use business objects without wrapping them in controllers (like a session bean)


    If they're using session beans or controllers in the actions, I can perfectly understand that. You have to use the business logic somewhere. :-)


    On my current project, we have a (yuck) flash-client (using macromedia's Flash Remoting MX, btw. nice thing, saves a lot of time usually spent on devicing your own xml-based protocol to communicate with the flash client) . The flash client accesses a standard java class/bean. This bean contains code to massage the output from a session bean to simple data structures more suitable for a flash client (and programmer. Ok, low blow. :-)


    The session bean acts as an facade to all the functionality required by/provided to the client (authentication, fetching and updating data etc.) The system has about 10 session beans and quite a few entities.


    We've used this approach before, and when we had to add some new types of clients, we only have to add a bean convert to/from client requests and the controller (session bean).
    (At first, we only developed a Flash client. Later, we added a SMS client and a web client.)

    1. Re:What's not so good? by ShinmaWa · · Score: 1

      Hm. I'm not quite sure I follow you here. I haven't read the book, only your review, and I'm a bit puzzled by your statement regarding business objects in actions.

      I've not seen the offending code either, but I think I understand the nitpick.

      In a prestine MVC environment, the business objects (the Model layer) should never be exposed to or by the view or controller layers. In other words, BusinessObjectA should never be used directly by ActionHandlerB, but rather use things like contracts and lightweight objects to seperate their concerns.

      Problem is that setting up lightweight objects and contracts confuses the issue at hand in sample code. With all the infrastructure needed to keep your MVC structure prestine, the point of the example gets lost in the noise.

      I would probably defend the author's decision to break the model a little to improve clarity, rather than have pages and pages of infrastructure simply to keep the MVC infrastructure completely spotless.

      --
      The /. Effect: Thousands of users simultaneously accessing a site to not read its content.
  20. Struts 1.1 by Free+Heel+Skier · · Score: 1
    Struts 1.1 is currently in Beta3, and it is going to fill in many of the gaps where the previous releases of Struts was deficient. I have been developing in struts for quite a while now (almost 2 years), and have had to desing a couple of patterns to make some things happen. This should all be fixed.

    Struts 1.1 has added nice features like Dynamic Action Forms, integration with JAAS for request level authorization, and separation of functionality through modules.

    If you have not previously used Struts this may not mean anything to you. Trust me when I tell you that these advances will be very welcomed by Struts users. I higly reccomend learning Struts, however the existing books only cover previous versions. If you are looking into using Struts on a future project you may want to check out the upcoming release.

    Life is like an elevator, sometimes you get the elevator and sometimes you get the shaft.

    1. Re:Struts 1.1 by blackbearnh · · Score: 1

      As co-author of Struts Kick Start, I'd like to point out that the material in our book is current to Struts 1.1 beta 3 (which just released), with a few minor changes (some of which I instigated and implemented, such as the new action= parameter for html:link)

      Both Kevin and I are committed to keeping the errata on www.strutskickstart.com up to date with the release as it heads toward final.

      James

  21. Husted book by Anonymous Coward · · Score: 1, Informative

    Actually, what I would like to see is a review of the Ted Husted book Struts in Action , ISBN 1930110502. It was listed as not published yet yesterday at amazon.com, but is now listed as "usually ships in 13 to 14 days." It is available sooner at bn.com or direct from the publisher. Husted is one of the more well-known Struts gurus, and I think his book has been much more anticipated than the one reviewed.

    One thing I like is that the publisher, Manning Publications, lets you buy a PDF version of the book for half price. They will also deduct the cost of the PDF version if you decide to buy the tree version later. There are a couple of sample chapters online, one about integration with Tiles and another about validation. The sample chapters I have read seem very complete and well-written.

    I know this post sounds like an advert for the book, but I'm not associated with the book in any way. I'm just a Struts developer who's been waiting for a good Struts book to come along, and the Husted book looks like it might be the one.

    1. Re:Husted book by Anonymous Coward · · Score: 0

      already reviewed at the slashdizzy:

      http://books.slashdot.org/books/02/11/25/1731249 .s html?tid=156

    2. Re:Husted book by blackbearnh · · Score: 1

      I'm informed by our publisher that Struts Kick Start should be available via Safari within a few weeks. You can also view a sample chapter (on Dynaforms and the Validator) in PDF format at: http://www.strutskickstart.com/ James Turner

  22. Re:Happy Slashdot New Year by Anonymous Coward · · Score: 0

    It's funny because sadly, it's true! Spot on post all 'round. MOD PARENT UP!!

  23. looks like the abstration in asp.net by xdrone · · Score: 2, Insightful

    his looks like the abstraction used in asp.net which changes the interaction of web pages to an event based model rather than just posting back forth and checking user values. (correct me if i'm wrong)

    it's a big step forward cleaning up web programming. i'm sure it will come to php sooner or later, although i'm happy with old stylee.

    1. Re:looks like the abstration in asp.net by joib · · Score: 2

      I'm no php man, but I hear that phrame is a struts clone for php.

  24. Wow... by Anonymous Coward · · Score: 0

    ...what a thin review. The styrofoam cup is more dense that this. Makes me want to run right out and buy this - not.

  25. If you're not committed yet, check out XMLC. by brad.hill · · Score: 2

    XMLC and Barracuda offer a nice alternative to Struts without all the crap of JSP and the enormous clusterf**k single XML file that Struts uses.

    XMLC enforces a nice clean seperation of code and presentation data and has a great framework (Barracuda) that does everything Struts does and more. (polymorphic event dispatch and real OO event handling, for example)

    Check it out at www.enhydra.org. There's also a great book out on XMLC, if you prefer paper.

    1. Re:If you're not committed yet, check out XMLC. by pihana · · Score: 1

      Yep, and Barracuda also supports components. Components can be bound to a view, and will perform the rendering tasks. I've been using XMLC for 2 years, I'm sooo glad I don't have to use JSP,PHP,ASP or other presentation languages.

    2. Re:If you're not committed yet, check out XMLC. by texas_mustang · · Score: 1

      Our app is struts based & we have it split into multiple subprojects. Each subproject has it's own struts-config.xml. At build time we use an Ant task to combine into one file. Works flawlessly and we can mix & match subprojects by release.

      I do agree with you about JSP. I preach to our team that anything you do with javascript or scriptlets can be done with a custom JSP tag, but in the end it just comes up short and we end up writing script or generating it. Either way I'd rather not do it.

  26. similar to CSS? by miltimj · · Score: 2

    I've never used Struts, and my web apps are almost all Perl/CGI, but I'm still curious (of course)..

    Would this analogy be reasonably accurate?

    Struts : web apps as Cascading Style Sheets : HTML ?

    --
    "Truth is not decided by majority vote" consensus gentium -- Norman Geisler
    1. Re:similar to CSS? by Phoukka · · Score: 2

      Err, no. Or, not really. Or maybe, just not quite. You see, on one level, CSS is used to separate presentation from HTML, leaving structure & semantic meaning only in the HTML code. Struts is used to enforce separation of business logic from presentation logic. So, at a really REALLY high level, they do similar things. But the analogy dissolves as soon as you get to even 50000'.

      With Perl/CGI + (X)HTML + CSS, you very likely are coding in a procedural style (feel free to correct me if I'm wrong -- or, just don't take it personally, let me explain the idea) in your CGI script. With Struts + (Tomcat or other servlet container) + JSP + HTML + CSS, well, things get more complicated -- yet easier to code and maintain.

      With just Tomcat + JSP, you can code up a servlet, the Java equivalent of /successor to a CGI script, and that one servlet will handle all input, all business logic, and all output. But this style of coding is generally considered bad, because it is much more complex than it should be -- it hinders maintenance, updates, performance, clarity, etc. Java, being object-oriented, allows the programmer to separate business logic from web app control flow from presentation. However, it doesn't enforce it. And that separation is not necessarily easy, it requires discipline and creates more work if the coder starts from scratch. Which is where Struts comes in to play. Struts is a framework of Java code that works with Tomcat (or other servlet container), that enforces separation of business logic from control from presentation, and provides lots and lots of goodies that make it much much easier to code the application.

      So, if you have an application that isn't throw-away, one that will need to be maintained and possibly changed later, Struts makes building the application easier because it keeps unrelated parts from bumping into each other, and has lots of pre-fabbed goodies.

  27. XSP vs. JSP?? by Hurricane_Bill · · Score: 1

    Can anybody help explain the difference, as well as pro's/cons of using XSP vs. Java?

    I've been thinking about learning JSP for web development but recently I've started looking at Apache Cocoon which is an XML framework, built on java. It uses XSP to call java business logic which then gets rendered in html. This looks very similar to JSP (except for the XML stuff).

    1. Re:XSP vs. JSP?? by deaconBlue · · Score: 1

      I think your post contains the answer.

      ASP and JSP, so called embedded languages, allowed developers to install dynamic elements in an otherwise static page. A step forward in the division of labor and code re-use; developer A submits the 'date & time' tag or fragment to the HTML designer and, voila, date and time is stamped into the page or some database output or whatever.

      Problem: because the page would then dump to the browser, the JSP or ASP tags were also responsible for their 'chunk' of presentation. We've learned that this 'mixing' of controller and view or data and presentation is inflexible, but sometimes expedient and easy to explain.

      Answers: Cocoon and Struts are strong in 'separation of concerns' or the breaking apart of the data-model, the presentation or view of data, and the controller that binds the two.

      Cocoon begins by generating content via 'generators' and xsp tags which merely create xml data. This xml is later styled into something pretty. If you don't like the presentation, you can always adjust the style. If the data source changes, just adjust the generator or revise the xsp.

      Cocoon is strongest in content intensive endeavors, like catalogs and magazines, blogs and so forth.

      If the need is to build something implicity dynamic, a real web-based application with a high degree of interactivity and non-determined and perhaps customized presenations, struts may be your answer. Think of porting one of your favorite apps, maybe an enterprise e-mail/scheduling system or shop-floor planning application, to the web. Struts is very strong here and 'plays' very well with other EJB based 'models' and 'controllers' in the enterprise.

      HTH!

  28. Struts ported to PHP by tetranz · · Score: 2, Interesting
  29. Just more retreading on the same tire... by javabandit · · Score: 2, Insightful

    I have used Struts, and personally, I really don't see anything special about it. While I agree that having "scriptlets" in your HTML is generally bad form, I have similar problems with putting Java-centric tags in presentation code as well.

    Struts, Java Server Faces, Servlets... All of these tools do not solve a real issue at hand, which is that when it comes to internet/HTML applications, the presentation layer should not tie you to any language, or to any language-specific framework.

    I should be able to write a "View" that simply Looks at a standard XML-based model, and construct my page from that. Without having to put any kind of Java or Java-based tags in my code. XSLT comes far in doing that, but has a few shortcomings.

    The missing piece is a standardized interface upon which posts/gets etc... can be performed without regard to the View, or to the language used in the application server. This interface should of course handle necessary things such as session management, authentication, and the like. This way, we could change out our underlying backend without having to change the presentation code at all.

    This is where I give CORBA a lot of props. It definitely had some problems, but it was a wonderful intermediate interface that didn't care who its client was. As long as the client spoke IIOP... life was good.

    The same should be done for web interfaces. The presentation layer should not care beans about the backend... expect that the container is aware of a common/neutral interface. No vendor specific tags. No language-specific tags. No proprietary garbage that ties you to any particular container.

    XML, XSLT, XSD are great. Java is great. All these technologies are great. But the lack of a common interface/framework which seamlessly ties them together for web applications is the real problem.

  30. Business Object Persistance and Caching by Apoptosis66 · · Score: 1

    We are doing a rewrite of our web application, and have pretty much decided to use struts. However, we can not decide on what to use for object persistance and caching. We have ruled out CMP for performance reasons, BC4J is a option but many of us don't like being tied to Oracle. Are there any open source frameworks for doing this that someone has used successfully and are happy with? Object Relational Bridge? Torque? We could really use some outside input on this.

    1. Re:Business Object Persistance and Caching by TapestryDude · · Score: 1

      Happy developers use Tapestry (not Struts) for presentation, and Cayanne or Turbine for persistance. Cayanne is inspired by Apple's Enterprise Objects Framework (EOF) in much the way that Tapestry is inspired by Apple's WebObjects.

      --
      Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
  31. Re:IN SOVIET RUSSIA by Anonymous Coward · · Score: 0

    lame-o

  32. Tapestry and Struts by TapestryDude · · Score: 1
    Got an hour or two?

    First off, I probably shouldn't have even brought up Tapestry, I'm generating a bad reputation for trying to monopolize discussions and steer them towards Tapestry.

    Struts rounds off the rough edges of servlet/JSP development. It does a little streamlining, such as creating an abstraction between actions and JSPs. Actions are subclasses of a struts-provided class and are very, very similar to servlets ... in fact, they must be stateless, just like a servlet.

    JSPs are called "forwards" and, in fact, the plumbing doesn't require that the output be JSPs, you can plug in other templating systems such as Velocity.

    There's standard taglibs that help with creating URLs that reference actions, help with building forms, and there's a system, called form beans, where query parameters are picked up and dumped in as properties of a bean, which is then passed to an action for processing.

    That's really about it.

    Tapestry is simply a different kind of beast. It's goals are different ... it doesn't round out the edges of the servlet API ... it makes the servlet API irrlevant to the developer. You create Tapestry applications without thinking about URLs, query parameters or any of that jazz. It's all "objects, methods and properties".

    Let's take a simple form example. In Struts you would have to

    • Create a JSP
    • Register the JSP in the struts_config.xml
    • Create a html:form tag and identify the action it submits into
    • Create html:textfield and etc. tags. These pull properties from domain objects and create HTML form elements from them.
    • Define a form bean class to receive the submitted values
    • Register the form bean in struts_config.xml
    • Create an action to receive the form submission (and register it in struts_config.xml)
    • Put code in your action to extract properties from the form bean and apply them to your business objects

    Struts doesn't have any kind of namespace management, so if you are on a a big team, you have to be careful to name things uniquely.

    In Tapestry, you would

    • Create a new page template
    • Create a page specification for that template
    • Add a Form component to the template
    • Add various form components to the template
    • Define a listener method for the Form component
    • Create a page subclass
    • Create the listener method for the form

    Although this looks similar, its much easier in Tapestry. Everything you need to do is localized in the three resources of the page (the specification, the template or the class). You write very, very little code ... instead, you declare what you want the framework to do inside the page specification (an XML document), or even inside the HTML template (more like taglibs, and a 2.4 feature in progress right now).

    These page specification entries are pretty short, for example:

    <component id="inputName" type="TextField">
    <binding name="value" expression="employee.name"/>
    </component>

    This says "use a TextField component, bind its value parameter to the name property of the employee property of the page". This assumes that your page class provides a JavaBeans property, "employee". The accessor method knows how to obtain this object from a backend database or EJB.

    You and the other developers aren't conflicting on access to struts_config.xml. No change that another developer makes to thier page will break yours. Name conflicts simply can't happen ... each page is like a little application unto itself.

    In both frameworks you have to provide the business object to the form. In Struts, an action has to store a bean as a HttpServletRequest. In Tapestry, the page provides an accessor method that exposes the business objects to the components on the page.

    Tapestry does much more work for you when the form is submitted. Notice that you don't specify a URL, action, page or anything with a Form component, you simply tell the Form component what method to invoke when the form is submitted.

    The form components will pull request parameters, convert the parameters to correct Java types, and apply changes to the properties of the business object. If you are using the validating text field component, then more conversions and validations occur, automatically (and properties are only updated if the input is valid).

    Once all the properties have been set, the Form will invoke the listener method which carries things forward from there, including selecting which page will render the response.

    On something like a login page (i.e., user name and password), you don't need a seperate business object; your form components can simply update corresponding properties of the page object itself.

    Right there is one of the big differences; the objects Tapestry users work on are stateful, not stateless. You don't have to deal with that problematic indirection (storing everything as request or session attributes). Tapestry does the shuffling of data to and from the session for you, invisibly. It uses object pooling so that you code naturally (objects with methods and properties) without worrying about multi-threading issues.

    Now, that's just off the top of my head and doesn't scratch the surface of what Tapestry can do. The important thing is that its all about components, and creating new components (and even packaging them into libraries of components) is a snap, in fact its often a necessary and natural part of creating an application.

    Unlike taglibs, Tapestry components can (and usually do), have their own templates and often are constructed from other components. Very natural, much more like a Swing GUI in terms of composition.

    Because all of the request dispatching is performed by the framework (both during render, when the framework creates URLs, and in subsequent requests, when the framework interprets those same URLs), components can have thier own private listeners and behaviors.

    Thus you can have things like MindBridge's Table component, that has sortable column headings. The links for the headings are components embedded within the Table component, and the Table component provides the listeners for those links. You can have ten Table components on ten different pages, or ten on the same page and everything just works, no questions asked.

    Everything in Tapestry is designed to assist the developer ... wringing more functionality out of less effort. When things go wrong, it has incredible exception reporting.

    Right now we're working on release 2.4 which includes significant improvements that will make Tapestry the easiest (and still, most powerful) web app framework available.

    There's reams of documentation at the Tapestry Home Page and you might just want to check it out (if you want something more coherent).

    --
    Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
    1. Re:Tapestry and Struts by richieb · · Score: 2
      Thanks for a great answer. I'm already familiar with Struts, I'll have to try Tapestry...

      --
      ...richie - It is a good day to code.
  33. which java where? by tunesmith · · Score: 2

    Here's what I don't understand - what jakarta technologies are mutually exclusive with each other? I did apache jserv development for a couple of years and I want to update by using java for a large scale personal project. My brain is tumbling around several options:
    1) struts
    2) tomcat/jetty
    3) EJB (jboss/resin)
    4) enhydra

    So, what can be used with what? Can #1-#3 be all used together? I mostly just want to gain wide experience to help the old resume.

    --
    skkkoooonnnggggkkk ptui
    1. Re:which java where? by ChannelX · · Score: 2

      Enhydra is an app server. they have supporting APIs to create web apps (XMLC for one...I think Resin might support it as well). Resin is a jsp/servlet engine. There is an addon for EJB. tomcat and jetty are also jsp/servlet engines. Struts is an API for doing JSP/servlet development. It uses jsp/servlets. JBoss is an EJB container. It would work in conjuction with jetty/tomcat/resin. Lots of the apache jakarta projects work with each other. That makes them somewhat confusing at times but it really is pretty cool.

      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
    2. Re:which java where? by Tom+Davies · · Score: 2

      1. Struts is a framework for writing web applications based on JSPs and servlets (Tapestry -- http://sf.net/projects/tapestry is way better) Struts (and Tapestry) can be used with any servlet engine.

      2. Tomcat and Jetty are servlet engines.

      3. EJBs are used for writing applications which *need* to be distributed or need to be buzzword compliant.

      4. dunno

      Tom

      --
      I have discovered a wonderful .sig, but 120 characters is too small to contain it.
  34. Re:MVC...spoiler warning! by MaximusPrime · · Score: 0



    ...or model/view/controller, was invented by ...

    Thank a lot dude, I wanted to find out in the book

  35. Heh by autopr0n · · Score: 2

    Of course, MS SQL is actualy more scaleable then MySQL, but that's beside the point :P

    --
    autopr0n is like, down and stuff.
    1. Re:Heh by Anonymous Coward · · Score: 0

      A guy I know works for a company that has a MySQL-based site that handles 70 million hits a day well. Can you say the same for MS SQL?

  36. The problem with web development in java by codepunk · · Score: 2

    The problem with web development in java is two fold. It is slow and not a very productive environment. PHP, NET and Perl will always be more productive. Now the PHP ported struts framework, now we are talking.

    --


    Got Code?
    1. Re:The problem with web development in java by ChannelX · · Score: 2

      I see you have never used Java and have absolutely no clue what you're talking about. Java is not slow. It is not slow on the server. It is not slow on the client. JSP/Servlets/EJB with or without Struts, etc are as productive as PHP, .NET and Perl. There are tons of options out there for doing web-based development in Java.

      --
      My blog: http://jkratz.dyndns.org/~jason/blog/
  37. Review, Safari, sample chapter by Anonymous Coward · · Score: 0

    Thanks to AC for the pointer to the Struts in Action review, I don't know how I missed that one. I put in a link, since your URL got munged by the Slashcode...

    And, thanks to James Turner for the heads-up about Safari and the sample chapter over at strutskickstart.com. I'll check it out right away. Good luck with the book, it looks like it is getting a lot of good reviews so far.

  38. Re:was the Struts Kick Start site built with Strut by blackbearnh · · Score: 1

    It was built using Userland Radio, and we haven't set up the RSS channels yet. I've been busy helping with the 1.1b3 Struts release... James

  39. Don't make me laugh. by Anonymous Coward · · Score: 0

    really, enhydra is just awful. Too bad you wasted time writing it.

  40. Try Tapestry by Tom+Davies · · Score: 2

    http://sf.net/projects/tapestry

    This is *much* nicer than struts/JSP. It makes producing reuseable components much easier, and abstracts servlets very nicely, while still allowing access to the bare meal if needed. And it has the best documentation of any OSS project I've seen!

    Tom

    --
    I have discovered a wonderful .sig, but 120 characters is too small to contain it.
  41. Struts is great for newbies too... by red+elk · · Score: 1

    As someone who has recently moved over to Java from other languages, Struts has really helped me understand MVC and the power of XML to control large applications. Servlets are extrememly powerful and robust and very handy to be controlled from one line of code in the config.xml... If you want to see some of cooler things you can do with struts, check out keyboardmonkey's site- servlet tree hierarchy... very handy.

    For all those who have never tried out the struts framework- give it a chance... and you don't need a $50 book to try it out. Try out Ted's Tutorials and learn through example!


    www.startvino.com