Blogs

SpringSource Blog

First Spring Framework 3.0 milestone released

Juergen Hoeller

I'm pleased to announce that Spring Framework 3.0 M1 is finally available for download!

This release features several major changes, including a start of the major 3.0 themes such as EL and REST support:

  • revised project layout and build system with module-based sources
  • updated entire codebase for Java 5 code style (generics, varargs)
  • updated to JUnit 4.5 and JRuby 1.1
  • introduced Spring EL parser (org.springframework.expression package)
  • introduced support for #{…} expressions in bean definitions
  • introduced expression-enabled @Value annotation for embedded expressions
  • introduced @PathVariable annotation for URI template handling in MVC handlers
  • introduced default value support for @RequestParam in MVC handlers
  • introduced @RequestHeader annotation for HTTP header access in MVC handlers
  • introduced AbstractAtomFeedView and AbstractRssFeedView base classes
  • introduced <spring:url> and <spring:param> JSP tags

as well as various minor enhancements.

Note that Spring Framework 3.0 requires Java 5 or above and J2EE 1.4 or above. We are building on Java 6 and Java EE 5 as the primary platform levels – but rest assured, we will retain compatibility with Java 5 enabled J2EE 1.4 servers such as WebLogic 9 and WebSphere 6.1.

We also removed/deprecated several classes that became outdated. More information about deprecations and the corresponding migration paths will be available in the 3.0 M2/M3 timeframe.

As a change from previous releases which were hosted in CVS at SourceForge, Spring Framework 3.0 is being developed in our new Subversion repository which can be found at: https://src.springframework.org/svn/spring-framework/

Feel free to track the ongoing work as we move closer to Spring Framework 3.0 final… and let us know whether you like what you're seeing :-)

Similar Posts

Share this Post
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Slashdot
  • Technorati
  • Twitter
 

51 responses


  1. Thanks for adding new features/enhancements to MVC part.


  2. Could you add Maven dependency snippets?

    Also, are there any updated estimates for a JavaConfig 1.0 release?


  3. Juergen,

    congratulations on the release!

    Is there any chance you guys might consider switching to Git SCM? ;-)

    Cheers,
    Dmitriy.


  4. I am also curious about that. Did you evaluate the possibility of Git instead of SVN, and in that case, which were the reasons involved in your final decision?

    Congratulations on the milestone release :)


  5. @Jörn,

    JavaConfig 1.0 GA will release with or immediately following Spring 3.0 GA.


  6. @Dmitriy & @Ignacio,

    We did not consider Git.


  7. @Arjen,

    does it mean you're not planning to look at it and consider it in the future? ;-)

    Cheers,


  8. Thanks Chris! I'm then looking forward to the final release of both :-)


  9. I am curious as to why the Controller hierarchy has been deprecated to be replaced by an annotation driven approach. In my latest project I took an admittedly quick look at the annotations driven approach and found it to be less elegant and readable then the traditional approach. I am well aware inheritance has become a bit of a dirty word in object design circles recently however IMO I believe inheritance is suitable when used in a technical framework and the open closed principal is followed. I like being able to inherit from the level of abstraction that I I find appropriate at the time. Why has the "old" controller framework been deprecated why not just support both? What does the annotation driven approach give me that the traditional methods dont?


  10. Congrats on the release Juergen!


  11. What about maven packages?


  12. Hi,

    I haven't really gone through the source yet, but what I get from comment @Richard 's comment is that in favour of Annotations, the Controller inheritance heirarchy based approach is being deprecated.

    I think this is certainly NOT the way to go. Just because the language now supports meta-data in form of annotations, it should not discard old school OO concepts altogether. Personally, I simply do not like mixing configuration with code and hence, I rarely prefer annotations. Now, a majority might not be with me on this, but certainly I would not like myself pushed towards annotations like this.

    If at one glance at my config XML, I get an idea about all the controllers in my application, what's the harm? Why should I keep discovering controllers in based on convention (package-name etc.)?

    Please consider these views before taking such decisions. Java 5 is great, but not every feature from it appeals to everyone, and there are some good reasons for it.

    Thanks & regards,

    - Aditya Jha


  13. I want to echo the concern about the deprecation of the Controller base approach for MVC. I am somewhat wary of the annotation based way of doing things as it seems to tightly couple the configuration with the code. It seems like annotations makes it harder to use multiple instances of the same class of controller without creating superfluous subclasses that serve only to change the configuration of the base class annotations.

    I would strongly urge that there always remain an XML-based (or other approach that doesn't include the configuration attached to the code) method of configuration.

    David


  14. Can you add it to the Maven repository?


  15. Good job,
    Btw any plans on adding support for JSR286 ( portlet spec)?

    I see no support for serveResource in this release.


  16. Maven?


  17. @Richard,

    Spring MVC annotations are a much more elegant programming model for the web layer. They are quite expressive when it comes to setting up multiple request handling methods on a controller, they provide you access to data binding in a completely natural way, they enable very flexible method signatures, and much more. Not to mention a significant reduction of configuration. If you look around you'll find more information on the benefits. I think the deprecation is sending a signal as to which approach should be used going forward.


  18. I assume by JRuby 1.1 you mean 1.1.x, hopefully 1.1.5ish or so, right? Very excited to see JRuby support finally updated!


  19. Are there some more information around for the 'spring-build-system' and the 'Bundlor'?
    It would be nice to see some documentation in same quality as for the framework itself.

    Thanks,
    Jörg


  20. While I can understand that developers that are used to the inheritance based controller model are upset, I prefer the annotation based one now. It took me a while to get used to it but it dramatically increases testablity, which is a good thing. I am also quite sceptical regarding annotations, but controllers are mostly build, that no further annotations are contained in that class, so the deal is not that expensive. I can only recommend to play with it a bit.

    Besides that, I very much wait for the Maven artifacts… ;)

    Regards,
    Ollie


  21. Cant wait for JavaConfig, using type safe Java code for configuration is a valuable alternative to annotations and xml.


  22. @Rossen, @Richard

    Yes, they are much more elegant.
    Unfortunately the @Controller approach lacks of any validation processing flow:( From my point of view is a big disadvantage. Moreover I don't like the way in which validation is currently handled. Let's consider the form submit use case. First of all we has to pass @ModelAttribute("command") and then the corresponding BindingResult object as a method parameters. The first one is necessary since it does contain business data but the second one is required only for validation purposes. Even if the command's object fields were not filled properly the method will be executed. Then we have to do validation phase by ourself (check if the strings are empty or not etc.). During action execution we are forced to choose which view has to be returned based on the validation results:( Would it be nicer to run validation just after binding but before the method execution? In case of any validation errors just return the input view (the page where user entered data).

    I think something should be done in this direction. Keep up the good work.

    Regards

    BTW. Stripes could be a good example. There are @Validate/@DontValidate annotations that cause that the validation logic is called just before method execution.


  23. This is very exciting news indeed and much sooner than expected. What excites me most is the REST support about which I have two questions. Does Spring implement JAX-RS 1.0 like CXF 2.2-SNAPSHOT? And is there any documentation or sample code, however informal, on the REST support providing by 3.0-M1 as yet? Many thanks. Can't wait for Spring 3.0!


  24. @Rossen

    I respect all efforts on making Annotations elegent and easy-to-use. My only concern is that restricting other ways doesn't seem so 'open'.

    The very nature of Java has been, and still is, being 'open' and 'community-driven'. IMHO, taking stances like these somewhat undermine this basic nature. I can understand favoring one way to another, but keeping only one way of doing things (that too, by binding configuration to code) doesn't seem right.

    Please note that even today, class java.lang.Vector has not been deprecated. Even methods like 'elementAt' in this class have not been deprecated. Now, if you know what I mean, going by your logic they should have been deprecated long ago. Fact is, this class and those methods do not have something inherently wrong in them. It's just that they might not be suitable for most purposes. But, if someone wants to use them in spite of considering what they offer, its perfectly fine.

    IMHO, Annotations can never be a substitute for external configuration. Its not the question of getting used to another way of working, but its a question of binding configuration to code, and also of having a central repository of config artifacts as opposed to discover them by convention.

    Imagine Struts classic coming up with some fancy annotations and asking 'forwards' to be annotated into Actions! I hope you understand the concern.

    Frankly, this issue has the potential of stopping me from being an ernest user of latest releases from Spring portfolio. I would rather prefer v2.5 to retain configuration out of code.

    Instead of actually deprecating it, you might declare that no work will be done on 'simplifying' XML-configuration any more and future focus will be only on simplifying Annotations. However, please always ensure that any 'new' features in future are also possible through XML config. I, and I'm sure many of us, can live happily with current level of so-called 'complexity' of XML configuration.

    Best regards,

    - Aditya Jha


  25. it's will be great to publish :

    pom parent, because we dont't have it here :

    * https://src.springframework.org/svn/spring-framework/
    * no maven repo available to donwload artifact.

    If you want us don't try new milestone, it's a good way.

    Just publish the parent way is a good way.

    thanks


  26. @Aditya, @David,

    I think it's important to recognize that the MVC annotations play multiple roles. You both mentioned a desire to avoid coupling configuration with code, and that is perfectly understandable. However, keep in mind that using annotations as a replacement for the Controller hierarchy does not necessarily equate to a replacement of the "configuration" in the sense that I believe you are referring to it.

    In other words, using annotations to simplify the binding and to enable type-safe method parameters in place of lower level instances like the HttpServletRequest can be viewed as an annotation-driven adapter for invoking methods that are themselves less verbose and easier to test. It also provides a more natural way to group functionality together. For example, this finally resolves the much requested unification of "MultiActionController" and "SimpleFormController". Using @RequestMapping at method level is an alternative to providing a custom MethodResolver implementation.

    On the other hand, specifying the top-level path-matching with @RequestMapping is a replacement for an externalized HandlerMapping. I am assuming this is the part that actually bothers you. However, keep in mind that this is still completely optional. The HandlerMapping can still be externalized in XML if you prefer (with SimpleUrlHandlerMapping or BeanNameUrlHandlerMapping). That is a separate issue from replacing the Controller hierarchy and its relatively rigid method signatures with annotations and the flexibility they provide for adapting methods.

    To see some guidelines for gradually adopting the annotations, see Rossen's article on InfoQ: http://www.infoq.com/articles/spring-2.5-ii-spring-mvc

    Specifically, read the section entitled "Removing Class-Level Request Mappings". After reading that, I would be interested to know if his proposed solution alleviates your concerns about mixing configuration with code.


  27. Maven, please.


  28. To the many folks requesting that the M1 artifacts be made available via Maven, good news – they already are within the SpringSource Enterprise Bundle Repository. Just add the following to your POM files and you're good to go:

    <dependencies>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.core</artifactId>
    <version>3.0.0.M1</version>
    </dependency>
    </dependencies>
    <repositories>
    <repository>
    <id>SpringSource Enterprise Bundle Repository – External Bundle Milestones</id>
    <url>http://repository.springsource.com/maven/bundles/milestone</url&gt;
    </repository>
    <repository>
    <id>SpringSource Enterprise Bundle Repository – SpringSource Bundle Releases</id>
    <url>http://repository.springsource.com/maven/bundles/release</url&gt;
    </repository>
    <repository>
    <id>SpringSource Enterprise Bundle Repository – External Bundle Releases</id>
    <url>http://repository.springsource.com/maven/bundles/external</url&gt;
    </repository>
    </repositories>

    Where the above configuration depends only on org.springframework.core, you are of course free to depend on any / all of the bundles (projects). See here for a list of what's available: https://src.springframework.org/svn/spring-framework/trunk/

    If you wish to pull in all the bundles at once (instead of a la carte as above), you can do so by adding one more repository

    <repository>
    <id>SpringSource Enterprise Bundle Repository – Library Milestones</id>
    <url>http://repository.springsource.com/maven/libraries/milestone</url>·······
    </repository>

    and specifying the following dependency

    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.spring-library</artifactId>
    <type>libd</type>
    <version>3.0.0.M1</version>
    </dependency>


  29. Thanks Chris!

    Scott — LA Training


  30. @Chris
    Looks like core depends on asm, and when I view the core pom, no version is specified. It references org.springframework.parent, but I can't seem to find it. Where is the parent pom.xml located?

    Anyone else using maven, I was able to figure out what version to put in to get it to work:

    org.objectweb.asm
    com.springsource.org.objectweb.asm
    2.2.3

    org.objectweb.asm
    com.springsource.org.objectweb.asm.commons
    2.2.3

    @Juergen

    @Qualifier no longer works for me. I created a ticket:
    http://jira.springframework.org/browse/SPR-5355


  31. I'd like to see support for delegating the "rest" of a path to a subcontroller (sub-resource) from a request method, maybe whenever an @Controller-annotated object is returned. Like in Jax-RS with its idea of sub-resources. This makes it easy to position the same resource at various places in the URL space – the preceeding parts of the URL being used to construct/configure/stuff the sub-resource controller with its context attributes so it can do its job.

    Is such a thing possible in the new RESTful @MVC, or could it be included at some point without much pain?


  32. What is the story on the maven repository when hitting the urls directly? Usually you can use a web browser and browse what the artifacts are and even look at the pom files. The names have changed from 2.5 and while many of them can be inferred from the new convention, it's not clear what all the new names are.


  33. Oops, you did mention that the source link does show what's available, i.e. https://src.springframework.org/svn/spring-framework/trunk/

    With switching to the @MVC style, what is the plan on validation integration. Last year at Spring Experience 2007 they introduced the bean validator framework which looked very promising. I was hoping that would be part of the core MVC by now. As it is the latest release of spring modules validation is not even on the maven repositories.

    A colleague who went to Spring One 2008 was telling me about Spring js in the web flow package. What is the relationship between those in regards to validation.


  34. Can You change logging library from Jakarta Commons Logging (with its known problems and limitations) to Simple Logging Facade for Java (http://www.slf4j.org).
    SLF4J is more robust and flexible than JCL.


  35. Can You add “invoke� tag to spring bean xml to invoke custom methods, not only those starting with set/get ;-)
    I mean (curly brackets used instead of less and great signs):
    {bean id=�xyz� class=�x.y.z�}
    {property name=�a� value=�b� /}
    {invoke method=�init�}
    {list}
    {value}arg1{/value}
    {value}arg2{/value}
    {null}
    {/list}
    {/invoke}
    {/bean}

    It will allow configure ANY object, not only JavaBeans inspired POJOs and give unlimited power to Spring ;-)


  36. And last ;-)
    Add please Janino (http://janino.net/) to Spring Dynamic language support set (in addition to JRuby, Groovy and BeanShell).

    Janino is a compiler that reads a JavaTM expression, block, class body, source file or a set of source files, and generates JavaTM bytecode that is loaded and executed directly. Janino is not intended to be a development tool, but an embedded compiler for run-time compilation purposes, e.g. expression evaluators or "server pages" engines like JSP.


  37. I do agree with people who say that the Controller hierarchy should not be deprecated. For example, creating a wizard with the AbstractWizardFormController took me less time than trying this with annotations. This abstract class contains a lot of functionality that I don't want to rewrite using annotations. However, if I only need to create a page containing a form to submit, it's much better and faster to use annotiation based controllers :)


  38. Hi Mark,

    Thanks for the reply. I went through the article you mentioned. And though I'm still not convinced that the Controller heirarchy should be deprecated, the article did clear out some of my concerns.

    The question that still bothers me is that without using the heirarchy, will we be able to exploit the useful template methods, for example:

    1) To perform some activity onBind, but before validation.
    2) To decide (in a custom way) whether a request should be considered as a Form-Submit request.

    and so on…

    Also, I think the ease and simplicity in debugging the application (along with the source from SpringSource, taking it as one complete sequential flow) has some business value as well. This seems to be sacrificed while applying Annotations and convention-over-configuration.

    I strongly feel the way to tackle complex configuration is better tooling rather than concise, but unobvious code (like C-language).

    Kindly enlighten me if I'm wrong.

    Best regards,

    - Aditya Jha


  39. Coming from using and recommending Spring Framework to many clients(Blue Chip), I totally agree with people who say that the Controller hierarchy should not be deprecated. Annotations are useful but only in certain circumstances, annotations to replace the Controller tier are as bad as annotations to include Sql code in your Java Classes(JPA). For commercial applications where medium to large teams of designers/developers/testers are required it is simply implacable. I would strongly consider changing and recommending the Struts 2 Framework if the aforementioned was in the final release.


  40. Hello everyone,

    Is there any possibility of Conversation support in Spring 3?
    Jürgen gave an indication of a possibility of conversation support in presentation:

    Conversation Management
    • Key problem: isolating concurrent windows in same browser
    – shared HTTP session
    – several independent conversations going on
    • Generalized: conversation scope with shorter lifetime than session
    – scope="conversation"
    – Spring Web Flow providing sophisticated flow navigation management on top

    Pls let us know the status/availability of this important feature. Also, is there a possibility of Spring MVC and Web flow being combined into one single MVC framework in a future release?


  41. Hi,

    I started a post on Spring Web forum regarding the issue we have been discussing about (deprecating the Controller approach in favor of Annotations). Kindly provide your individual opinion on this change at http://forum.springsource.org/showthread.php?p=219218#post219218 .

    Thanks & regards,

    - Aditya Jha


  42. The certificate on src.springframework.org expired on December 21st.
    It is self-signed, which is another issue.

    Please update the certificate, thanks.

    Regards,

    Carlo


  43. Any update on conversation support in spring 3 ?

    Thanks,
    Razib


  44. Can someone explain why you changed the name of the maven artifacts?

    What does this means? (from the readme.txt file) "Furthermore, the jar file names follow bundle repository conventions now."

    If you look at the huge majority of Maven projects out there, everybody is using the same convention somehow (which is the one used in Spring 2.x artifacts).

    Are you planning to setup a relocation so that users can safely upgrade from spring-beans 2.5.6 to 3.0.0 for instance?

    I've seen many projects where stable modules use an old version of Spring. If you do this, the maven dependencies mechanism won't be able to resolve the version conflicts and users will get two version of Spring in their applications.


  45. Agree with Stephane.
    It will be a REAL NIGTHMARE for maven users when upgrading due to all artifactIds change !!
    This will break a lot of builds for people who wants to upgrade !!
    Please any chance to revert to this non backward compatible change ????

    Olivier
    Maven PMC


  46. I'm going to guess the new artifact Ids in maven might be something to do with osgi. I think their bundles had notation like that.


  47. Paul is probably right about OSGi. Here's some more information for those looking in, and it matters as much to Ant/Ivy-based developers as it does Maven-based developers.

    The issue with OSGi is that the transitive closure of Spring dependencies don't always have the proper manifest entries, and developers aren't stepping up fast enough to add the proper manifests to their own code. Without the library support, all the work of SpringDM was in jeopardy. So the SpringDM developers had to do it themselves. That's reasonable and admirable. I'm a big fan of OSGi and was really impressed with the SpringDM repo when I used it last summer. But there needs to be more thought in how this is done. I found the Spring repository very difficult to work with because of these renames and don't think it's wise.

    The problem is SpringSource cannot release artifacts in a dependency namespace that is not their own. Even if they could, they would make a mess of a developer's versioning scheme. I don't have an answer to this problem, but from my personal experience working with the Spring repo, the answer they came up with is a stopgap at best.

    Experienced Maven developers know what a hassle a duplicated namespace is. The original groupId namespace was flat in Maven 1, and some of the projects that were thriving during this time decided to be good neighbors and upgrade their groupId to the new hierarchical model within a major version number. A good case study is Ant's artifacts. When they changed groupId from 'ant' to 'org.apache.ant' without a major version change, they all but assured that there would be duplicated jars, since transitive dependencies on ant still used the older library groupId. If the groupId does not change, Maven figures it out by graph distance and does the right thing, but it can't do that if the artifactId or groupId are changed. This led to lots of time debugging builds and adding to dependencies that eventually pulled in artifacts with the old groupId (and there are usually a lot of them).

    A lot of developers swear by Maven, and if Ivy is any indication, so do a lot of Ant developers. Breaking the Maven/Ivy repository with critically important artifacts like Spring is a Really Bad Thing. Whether one likes Maven or not, this kind of tweak now affects Ant developers as well.

    So while I understand the need generated by OSGi, I hope the Spring developers will spend the time necessary to work with people like Oliver to make sure that Maven repository is not trashed like this.

    Cheers, Brian


  48. juergen, ur a genius! as a developer, u make our life easier..


  49. I have attended 3 SpringSource (now SpringSource2GX) conferences. At the 2008 conference in Florida, someone asked a Spring presenter why the sudden push for annotations instead of XML. The Spring presenter was flusterred and muttered, "because a lot of our clients don't like to use XML". I also remember hearing a Spring presenter tell us candidly not to worry about the rumors about coming deprecations, that it was simply the Spring lead developers being "over zealous".
    Well well well. So what do I do now with my library of expensive Spring books that are now obsolelete. Oh, wait. I mean, my library of expensive Spring books that are obsolute in some parts but it's not certain which parts are obsolete and which parts are not obsolete. Take the book "Expert Spring MVC and Web Flow". Should I just throw out the book? Which chapters am I supposed to skip, and which am I supposed to read?
    This is just crazy. Can you imagine trying to explain this sudden deprecation of a company's entire inventory of Spring web applications to a manager? Has Spring considered the maintenance headaches this will cost and cause in future years to corporate developers whose old web applications will stop compiling if they upgrade Spring?
    It's hard to believe, but at one time Spring was very easy to use and it's simplicity was a very attractive reason to use it. Ah, those were the days. Sigh.


  50. http://www.mmogstop.com is the leading provider of World of Warcraft Gold, FFXI Gil, RS Gold,EverQuest Platinum, Aion Kinah and EQ2 Plat. Buy WoW Gold cheap,…


  51. so glad to see you website. I think I'll scan
    it next time.mmogstopcom is the leading provider
    of WoWGold, FFXI Gil, RS Gold,
    EverQuest Platinum, and EQ2 Plat.
    MMOG STOP delivers fast, safe and
    always guaranteed.

14 trackbacks

Leave a Reply