JSF + Spring Data JPA + Maven using Eclipse - maven

I want to learn how to create maven project which handles Spring Data JPA and JSF. I tried to find a lot for simple examples but I could not. Can anybody please help me out? I am using Eclipse as a development platform.

They are technologies in opposite ends of the stack.
Learn basics of Spring Data from Petri
Learn basics of JSF here by MKYong
Both use maven.
For additional JSF resources, use for instance this as offset.

Related

Starting with Spring framework

I'm planning to start learning Spring but when I open any spring tutorial, I find many modules like Spring REST, spring MVC etc.
I'm really confused on how to start with spring, from which module to start, how are these modules related to each other, should I go through all the modules??
I tried searching many sites to answer my questions but couldn't find satisfactory ans, so thought of posting here. It would be great if somebody can guide me in this regard.
Spring is a java framework which provides solutions to several problems. So i guess it really depends on what you are planning to learn. The most important to learn first is understanding what Dependency Injection and inversion of control means. When you understand this you will understand why the rest of the frameworks are designed as it is. i suppose learn Spring IoC first since this is basically the core component of Spring Framework. Link: http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/beans.html
After learning Spring IoC, you can go on learning each specific Spring frameworks which address specific problems. For example:
Are you interested in Web development? --> Spring MVC
Are you interested in storing data to database? --> Spring Data
Are you interested in developing web services / web apis --> Spring REST
http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/overview.html
Start with Spring Core Module, which is the heart of entire Spring.
Spring Core Module helps in Injecting Dependencies (java objects) into
the Application at Runtime.
Please refer below URL for more details:
http://www.springbyexample.org/examples/core-concepts.html
A good knowledge of design patterns is essential for learning any framework in Java.
These Youtube videos can give you a good understanding of basic Spring.
As explained in the previous answers, start learning with the Spring core. You need to have a sound knowledge of servlets, JSP, Hibernate (ORM's) to understand the advanced topics.

Java EE or Spring for PrimeFaces project - any difference?

I'm planning a project which will use Primefaces to generate its UI.
I understand that PrimeFaces as JSF library is somewhat more at home with Java EE than Spring, although there seems to be a lot of examples of using it together with Spring.
Are there any notable disadvantages of using Spring instead of Java EE for the DAO and service layer in a PrimeFaces project?
It complicates the things, Java EE is complex enough for application developers(you need time to open dark parts and see the lights or i hope it:)) so my opinion if you don't have a requirement about it, don't use Spring and JSF together to better understand your bean lifecycle. You can find good dicussion in this source. I prefer to use HTML+Bootstrap and Spring MVC or use Seam Framework for JSF or no framework just use pure Java EE support with primafaces(JSF) can be good.

JSF Spring Hibernate project structure

I want to develop a project using with JSF, Spring, Hibernate technologies. I don't know how my project structure should be. Interfaces, implements, managedBeans, models, services, dao and goes on.
Is it possible you to guide me about this?
Thanks.
This JSF + Spring + Hibernate might be useful for you. Just follow all the procedures correctly and you will get what you want. Before I had tried it before. Or just download it's Source Code which you can find at the bottom.

Can a simple JSp and servlet code be migrated to Spring framework?

I am a newbie in web development. I'm using servlets and JSP for web development.However, I've learnt lately that Spring Framework is apt for that which incorporate servlets, jsp etc. So, my question is that can I now run my program using Spring framework ? Like, I have 2 jsp codes, and 1 servlet class. So, how can I migrate the code in Spring Framework ? what additional things or codes do I need to maintain ?
Migrating an existing J2EE project is easy.
You will get rid of a lot of "boilerplate" code in the process. The easiest way to do it in my opinion will be to use SpringToolSuite.
Import your project in STS and then add "Maven" nature to it. In the pom configuration you can edit all the jars that you need and mention the spring framework. Once all this is setup it will be just a matter of minutes to change the code if it is small.
You can follow these video tutorials about maven and spring to learn about it.
JavaBrains
There are more tutorials by "New Circle training" on youtube for the same.
I would also recommend you to read Spring in action 3rd edition-Manning
This book is a must and the best way to learn spring framework. Hope this helps

Should I learn Spring before Spring MVC?

I know java well, and have some experience in EclipseLink, Hibernate, JSF, Grails and some other stuff. but now I wanna learn Spring MVC for web apps and maybe for the sites. and should I learn Spring Framework before begin Spring MVC, or not?
In short, yes. Spring MVC borrows a lot of concepts like dependency injection from Spring, so you need to burn these concepts in before learning Spring MVC. For example, just create a simple Java project, create a few beans, understand the concepts of how a container / injection / wiring work, and then move on to implementing them in Spring MVC.
The most obvious benifit is you can integrate Spring with other web frameworks that you might already be familiar with. That way you get the best of both worlds, and don't have to learn Spring MVC until you have to.
This tutorial explains connecting to a database the spring way, and explains basic Spring concepts while at it. You could then follow it up with the Spring MVC tutorial.
Spring has an easy learning curve, (not to master it of course) so I would suggest learning them together on a small-scale test project.
I don't know if the question is pertinent for stackoverflow, but in any case I think learning Spring MVC is the best way to take a first step to learn Spring, in fact many Spring tutorials start with a Spring MVC application.

Resources