I am using IntelliJ IDE which by default generates a annotation based SpringApplication when I create a new Project for Spring Application. I want to first learn the concepts of Spring Application without Annotations(XML based). Could anyone give me suggestion for how to set in the IDE such that I get a non-annotation based project by default when I select for New Project.
The current version of Spring is
3.2.0
I created a basic annotation based Spring 3.2.0 app here : https://github.com/ajorpheus/hello-spring/
If you are comfortable with Git/Github, then clone that repository locally and import that project into Intellij using File -> Import Project ( otherwise, you could download the zip of the project itself : https://github.com/ajorpheus/hello-spring/archive/master.zip and then go from there. No git-fu needed.)
This project runs fine in Intellij as a maven project.
I have taken the liberty of also interpreting your question as 'How to learn Spring'. IMHO, here is what helped me when I was starting out with Spring.
First Steps
To start with, for further reading or a bit of experimentation, these seem like a good start :
http://projects.spring.io/spring-framework/#quick-start
http://spring.io/guides/gs/maven/
Books / Resources
I also recall that reading 'Spring In Action - Third Edition' helped when I was starting out with Spring, though I would not recommend buying it now since a much more up-to-date Fourth Edition is on it's way.
A couple of threads here also cover the topic of 'Best Resources for learning Spring' :
Book suggestion for Spring framework
https://stackoverflow.com/questions/1610733/best-way-to-learn-spring-framework
You'll find some books/resources repeatedly being mentioned is threads such as the above. 'Spring Recipes', 'Spring in Action', 'Pro Spring', 'Official Spring Documentation' ... all of these 'spring' to mind :D.
Finally, as far as Spring is concerned, there is no dearth of resources or threads advising about these resources. I'd recommend not spending a lot of time researching where to start. Just a pick a book which has been mentioned in more than one threads and go for it !
Hope this helps !
Related
Spring Dynamic Modules - is it alive project?
For example here has info what "Spring will NOT support any further releases as OSGi bundles. ". But here has Spring Dynamic Modules Reference Guide, where no info about discontinuing of the project.
Although the project is moved to Eclipse, it is more dead than alive. Pivotal has abandoned the project, which makes the Eclipse move more a code dump than a serious attempt to create an open source project. I would not advise building on top of it.
Its now Eclipse Gemini Blueprint, the change is described in brief here
http://www.eclipse.org/gemini/blueprint/documentation/reference/1.0.2.RELEASE/html/eclipse-migration.html
The fact that is never mentioned in the reference guide is strange for me also. Especially considering "While the project name has changed (to Eclipse Gemini Blueprint) and significant efforts have been made to reflect this in the project documentation and resources, there might be places that we have missed; if you find any, please report them to us."
Working migration guide link: http://www.eclipse.org/gemini/blueprint/documentation/migration/
How can I configure eclipse RCP with spring? Do I need spring dm?
Can you please show me a tutorial on how to configure spring with Eclipse RCP or Eclipse RAP?
How can I add spring to Eclipse RCP and just use it? How can I see the context everywhere?
Do I have to add something to my Target Platform?
Is there any tutorial or can you please tell me more details?
I just want to use Spring with my Eclipse RCP application.
Using Spring DM is not the only way, but I believe it's the easiest and most complete/correct way of doing it. Prior to Spring DM, there were several projects with the goal of integrating Spring and Eclipse RCP, but none of them were very simple, or very Spring-like. I have come across a blogger who is currently writing a series of articles on integrating Spring and Eclipse RCP using Spring DM. The first 4 articles cover exactly what you need to know with examples (step 0 through step 3).
The entire list of articles is here:
http://angelozerr.wordpress.com/category/java/spring/spring-dm/
That same blogger talks about his own RCP/RAP project (where he is using Spring DM) in another set of articles. These are in French, but using Google Translate makes them useful for non-French speakers. Take a look at step 7 and step 8 here:
http://angelozerr.wordpress.com/about/dynaresume/
I recently wrote a blog about this topic, you can find step-by-step tutorial here: http://blog.novatec-gmbh.de/step-step-spring-eclipse-rcp-applications/
I think my answer might be helpful to anyone (like me) looking for building Spring DM, OSGI console application.
Although its been quite sometime Since Spring DM has been inherited as Gemini Blueprint, it is recommended to use Gemini Blueprint instead of Spring DM. Nevertheless, Spring DM is also a good starting point.
This tutorial is worth looking at: http://www.jroller.com/dbrosius/entry/osgi_spring_dm_w_o
It provides step by step information
NOTE: There is a small package-name typo in Manifest.MF file that needs to be fixed. Eclipse will flag it so it's a non-issue
I just got a book from Apress (Spring Recipes), and I started to learn the Spring framework and now I have a problem. I followed the steps in the book to add the Spring .jar-s to the build path. Everything seems to work fine, but the code I have just doesn't work.
My question is that: do you know about a good tutorial for integrating Spring with Eclipse? I googled for a while and I only found old tutorials (from 2007-2009) which just doesn't work with Eclipse 3.6.
use STS - Spring Tool Suite. It is built-upon Eclipse IDE. http://www.springsource.com/developer/sts
STS helps hugely (you can get it from the Eclipse Marketplace for free). The features of it I particularly like? Here's a few:
As a user of XML-based configuration I love having the bean graph visualized – it's great for reports – but the content assist when filling out bean properties is invaluable, both for names and for values (i.e., it makes writing that much XML not suck too much). I imagine that if you're heavily using autowiring or Java configuration it's less useful.
Refactoring support is also good (these days; it used to have bad bugs so you want to be patched up to date) and I've found that the pointcut search to be the only way to write a complex aspect without lots of round-trip testing.
But not all of STS is perfect. In particular, some of the content assist modes don't (seem to) help (me) that much, and it really only works well if you have your properties defined using public setters. Still, it helps a lot…
Apart from using STS as suggested, you can use spring and eclipse without any integration. There isn't that much an IDE integration can offer anyway (apart from autocompletion in the xml, and linking the xml to classes (inclding aop))
I'm trying to get started with JAVA/Eclipse/Spring MVC but can't seem to find a "dummies" or "step-by-step" guide for setting everything up and creating the simplest proof-of-concept application.
I found http://static.springsource.org/docs/...-step-by-step/ but there seem to be differences between Spring 2.5 and Spring 3 so i'm looking for something for Spring 3.
Also, the tutorial for Spring 2.5 focuses on building the application usign Ant - This i will certainly be doing for releasing but when working within Eclipse i want to have set up the project so that i can use breakpoints/debugging and this is not covered at all.
I've downloaded Eclipse, Tomcat and the Spring 3 Framework but that's about it and within the downloaded Spring Framework documentation it states:
2.3 New getting started tutorial
There is now a new getting started tutorial
for developing a basic Spring 3.0 MVC
web application. This tutorial is a
separate document that can be found at
the Spring Documentation page
However, i can't seem to find such a tutorial on the linked page. My main problem at the moment, as seems to be the case for many people trying to get started with Spring, is that i can't seem to get everything set up.
I've got a copy of Expert Spring MVC and Web Flow and i've also found this tutorial but i don't know if the setups they describe are still relevant and whether they will allow debugging.
Can anyone please give some direction?
Thanks
Get the mvc-basic or the petcare sample apps from the Spring Samples SVN repository. These samples have been updated to Spring 3.0 and are directly importable & runnable with SpringSource Tool Suite.
I am also started to learn Spring 3.0 and i am not getting any help means any tutorials. but i find this site http://viralpatel.net/blogs/2010/06/spring-3-mvc-create-hello-world-application-spring-3-mvc.html and its very help full for start up development. but still i am finding another example so that i come to know more about it
if anybody knows some example in spring 3.0 then please provide me.
Thanks
Dhrumil Shah
These days, I think the easiest way to find out how to set up a spring application is by trying out Spring Roo. It may not be what you finally end up using when coding your project but it shows you exactly how to setup a Spring MVC web app.
I've also been looking all over for a full Spring MVC 3.0 tutorial with Eclipse that I could follow and haven't had too much luck in my research. The closest and most helpful example that I could find is here: http://krams915.blogspot.com/2011/01/spring-mvc-3-hibernate-annotations.html. This is also a maven project, but I was able to move some things around in my Dynamic Web Project within Eclipse and at least get the initial page to come up. Currently, I'm having issues with spring finding my controller class, but I think that's a part of changing the configuration files to meet my project needs. But try it and I hope it works for you!
I found these tutorials really helpful:
http://krams915.blogspot.ch/p/tutorials.html
I wanted to use REST and MongoDB and followed following tutorial with success:
http://krams915.blogspot.ch/2012/01/spring-mvc-31-implement-crud-with_4739.html
I hope it helps. I know how you feel :) Had the same issues. But it's worth sticking with Spring and learning it. It's a great framework once you know it.
Personally I made not so good experiences using Spring Roo. It can help you maybe a little bit for investigation how to setup a project but if you are new to Aspect Oriented Development you'll have a hard time figuring out what Spring Roo does. It can help you to setup a project really fast and easy but if you don't understand what's behind the facade it's hard working with it. This is not really for a beginner and no necessity for any project. But Aspect Oriented Development is worth wile learning and can be very useful to avoid boiler plate code.
Another route might be use appfuse, specifically using maven to generate the application template code from the appfuse archetype. E.g. this link.
There is a major difference in Spring 2.5 and Spring 3.x, Spring 3 or later introduces Annotations based bean wiring and dependency injection.
The nice step by step tutorial i found is http://www.journaldev.com/3531/spring-mvc-hibernate-mysql-integration-crud-example-tutorial
When building our Java applications in Eclipse, the Spring builder is very slow and gives no status updates.
Specifically, I start building a project, and Eclipse's Progress pane displays
Invoking 'Spring Project Builder' on 'project name'...
for multiple minutes at a time, with no additional details.
I've already turned off the Spring AOP Reference Model Builder, and I just recently disabled the Spring project builder completely out of desperation.
I'm just building and using these projects, not developing them, so theoretically they should compile fine - but this is our development branch, so I'd still like to keep Spring on in case there's a nasty reflection error somewhere.
So, in order to keep using them, is there anything I can do to:
Speed the Spring portion of the build?
Display more detailed output during the Spring project building process?
Edit 2010-02-15 21:39 GMT:
I'm specifically referring to the Spring IDE plugin in Eclipse.
I'm assuming you're referring either to the Spring IDE plugin for Eclipse, or the SpringSource ToolSuite bundle.
The big performance killer that I've nailed down is the processing of <import resource="..."/> entries in the beans files. The plugin has an option for enabling the processing of these, and if turned on, it absolutely hammers performance - it searches the entire classpath (including libraries) for each imported resource, ever ytime something changes. I reported this as a bug, and thankfully it's been fixed, but not yet released.
The <import> support is just a nice-to-have, though, since you can manually add the imported files directly. Turning it off makes the whole experience much more edifying.
Try checking your validators. I remember having some issues at one point because I had a bunch of plugins installed which added a number of validators to my project and the build process took forever mostly because of checking all the XML.