2

I am tired of Java web, and started to learn Ruby on Rails because of that, but I just found this Framework and it looks promessing... But I am not in the mood to study more Java, so I would like to know if this one is worth my time ( that would mean, less configuration and action mapping and so on)

Is it better then Struts 2(WebWorks) ??? because those are way better then Struts 1 but still not a RoR.

Spring MVC ?

I would like a Hands On Opnion, not a specs compare.

Thanks !

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
Cristiano Fontes
  • 4,920
  • 6
  • 43
  • 76
  • 2
    Take Struts 1 out of your comparison. No one will advocate still using it for anything. Struts 1 and Struts 2 are common only in their name. – Steven Benitez Jan 17 '11 at 22:35
  • 1
    Check out http://www.playframework.org/. Its the most rapid Java based web framework I have come across. – Andrew Dyster Jan 17 '11 at 23:38

3 Answers3

5

I have successfully used Stripes in multiple low/medium navigational complexity projects since around 2007. It's a pretty good framework to have in your toolbox.

IMHO, Stripes has a relatively low learning curve assuming you have the following two concepts clear in your mind -
1. HTTP Request - Response cycle
2. Using JavaBeans in JSPs

While using Stripes, the only place you need to mess with XMLs is configuring the StripesFilter and DispatcherServlet in web.xml (standard filter and servlet configurations)
Besides that, all other configuration & mapping is via class/field/method level annotations.

Quick Start guide should get you running in 10-15 minutes

Comparison with Struts/Spring MVC - Personally, I never went back to Struts after trying out Stripes. Spring MVC did not exist then. I do use Spring MVC for more complex webapps.

Amol Katdare
  • 6,740
  • 2
  • 33
  • 36
  • 2
    all right, but don't confuse Struts with Struts2, they are totally different frameworks. – leonbloy Jan 18 '11 at 00:28
  • Stripes rocks! Just look at how elegant your webapp code becomes: http://en.wikipedia.org/wiki/Stripes_(framework) – Kdeveloper Jan 18 '11 at 08:57
  • And with struts2 and conventions I could rewrite that with half the code... As a matter of fact let me edit my answer and show you (if it is good form may be another debate). – Quaternion Jan 18 '11 at 16:48
  • @Quaternion Wow, the LOC argument. I assume you're talking about getting rid of the getters & setters? If so, please be informed that if you don't need to access the values of the ActionBean using EL in the JSP, the fields can also be made public (and so you would not need the getters & setters) – yihtserns Feb 12 '11 at 14:20
  • Perhaps I didn't understand the example, I don't use stripes the examples show a getContext setContext for some reason so it looked longer but perhaps it isn't needed, looking at further documentation it seems it is not. In a more constructive light, what features does stripes offer over S2? – Quaternion Feb 13 '11 at 04:35
  • @ Quaternion - http://www.stripesframework.org/display/stripes/Stripes+vs.+Struts2 – Amol Katdare Feb 13 '11 at 06:17
  • I've seen that before but it's a few years out of date. From what I can see there are very few differences currently in their capabilities... Probably the most significant differences are in their plugin/extension offerings. – Quaternion Feb 17 '11 at 21:34
2

The problem is not in language. At least for the last ten years it is mostly not in the language. Please stay with Java. Many people are tired of Java Web though - that is exactly why each year at least one new attempt to suggest a Java framework happens. Currently there are about 50 of presentation frameworks only. The so called "mainstream" Java technologies (Spring, Wicket, Struts and JSF) prove to be very very conservative after they reach some success and size.

The new wave like Web4j, Play and HybridJava concentrate strongly on making things back as simple as they were for Adam. Before leaving this (Java) world forever consider using one of those new.

Dima
  • 1,326
  • 2
  • 13
  • 19
1

This question: https://stackoverflow.com/questions/1619758/is-struts2-still-a-good-choice-of-web-framework-for-new-projects is about one user debating to use struts2 which may be pertinent to others making the decision.

Following is an example of Struts2, although struts has it's own tags which would make the follwing more maintainable I decided to go with plain html where possible to make it clearer how it automagically moves values to the action and then to the view.

/WEB-INF/content/hello.jsp

<%@taglib prefix="s" uri="/struts-tags"%>
<html>
    <body>
        <form action="hello-world">
            Enter Your Name: <input type="text" name="name"/>
            <input type="submit" value="Submit" />
        </form>
    </body>
</html>

When the above is submitted "name" is set on the following action (If I had encapsulated name with get/set the example would work exactly the same but be longer)

package struts2;
import com.opensymphony.xwork2.ActionSupport;

public class HelloWorldAction extends ActionSupport{
    public String name;
}

then this page is rendered /WEB-INF/content/hello-world.jsp

<%@taglib prefix="s" uri="/struts-tags"%>
<html>
    <body>
        <h1>Hello World <s:property value="name"/></h1>
    </body>
</html>

This is an example of Struts2 with conventions (one extra jar on the class path), no other configuration required.

Community
  • 1
  • 1
Quaternion
  • 10,380
  • 6
  • 51
  • 102