What can I use for data access, timers etc? Seam, jBoss, GlassFish? Or simply Tomcat + JSF + Hibernate/JPA?
I need add just one JSF component to Spring MVC pages but I am afraid I must rewrite whole web app to jsf and drop Spring.
jbo, If you are just interested in replacing your view layer, you need not switch to hibernate/jpa etc.. JSF can co-exist with spring MVC. Need not discard any of you business objects and DAO's.
Better option is to consider spring-webflow. It is built on spring-mvc. Also support jsf views
http://www.javaworld.com/javaworld/jw-11-2008/jw-11-intro-to-swf2.html
http://www.springsource.org/webflow
http://www.springsource.org/webflow-samples
I see here an example about using jsf with Spring.
Also take a look here.
Maybe it's useful for you.
Related
I am considering moving from server-side rendering view technologies like JSP, Struts to client-side rendering view technologies using AngularJS,
A popular Javascript framework for modern browsers.
When we are making this change and what are all the things that I may encounter.
If anybody who are experienced in Spring Web MVC and JSP development and would know how Spring MVC can work together with a client-side Javascript like AngularJS.
Kindly Answer.
You have to rewrite the view part using angularJS, and replace the logic from the server with a REST API.
It's often a huge work, and the hardest part is to migrate the existing server-side session management to the browser, because a REST API is stateless.
Below is one of the suggested way in which i recently migrated my existing spring MVC web-application in Single page application using AngularJs as client side java-script framework:
1).First you needs to bisect your core business logic which must needs to handle in DB layer,if not done already. i.e. SP's,trigger's,etc...
2).Then for the thing mentioned as hardest by Toilal ("to migrate the existing server-side session management to the browser, because a REST API is stateless"), you can consider Spring Boot as one of the options to build things quickly instead of Spring MVC with fusion of java8 features to yield the JSON response via API's.
3).And than last but not the least, build UI layer with AngularJS in front End encapsulating the data returned by the spring boot API's. Please note that as angular is super power full, you can do most of your business logic at client side,your DB layer just needs to give you the whole bunch of business data to render the screen,other things you can easily handle in angular.
Thus, this way by making the DB layer thin and imbibing angular at front end, you can improve performance of your existing application drastically.
You can also check this AngularJS with Spring-mvc useful thread in same context.
Can we use Spring as Controller and Hibernate as ORM tool for an application with User Interface SWING??
If yes how??
How will be its directory would appear. How all injections will takes place. For simplicity maintaining a environment for saving Text fields input into DATABASE using Hibernate.
Spring could not be used as Controller in desktop application (Spring MVC is a web framework), but it can be used for features such as autowiring.
However Spring and Swing does not play well together, my last attempt failed due to really inconvinient configuration and lots of overhead code.
Some time ago there was a project called Spring Rich Client, but seems to be abandoned.
Anyway - internet is full of examples of using Swing with Spring, but you have to know that this pair is "not that popular".
Spring: How to Create Decoupled Swing Components
SPRING HAND IN HAND WITH SWING APPLICATION FRAMEWORK
Using pair of Hibernate and Spring is not different than in web-application case.
No. You cannot use Spring as a controller. But you can use core Spring container for using in Dao and Service layer. Hibernate for using Object mapping with Database Table.
I would like to design and implement a mobile web application using JQuery mobile and Java EE technology.
The application will consists of sales persons using the mobile device to take an order when they visit the customers. So the application will contain complex business logic.
I am confused as to with what frameworks I should pick/select to design and implement the server side of the application. So my question is should I use Spring, Spring MVC and Hibernate together or some other suggestion?
But I want to stick to Java technology as I am comfortable with it.
My next question is how will the JQuery mobile and the server side integrate with each other. I mean what are the ways/methods to integrate them?
Your best bet would be to avoid Spring in this case.
Use straight Java EE, with JAX-RS, CDI/EJB and JPA.
Your jQuery code will call JAX-RS resources (which are ReSTfull web services). Those resources are injected with Service beans, which are a combination of CDI and EJB. These beans will contain your super complex business logic. If they need to retrieve or store something from/into the DB, they will use JPA for this via an injected entity manager.
Is it possible to use facelets as view technology with Spring MVC? There is no mention about it in the official documentation, but I've heard that Facelets are very convenient and easy to use and I'd like to try it, I just don't know how...
It might be worth trying Spring Web Flow, that comes with JSF2 (facelets) support:
http://static.springsource.org/spring-webflow/docs/2.3.x/reference/htmlsingle/spring-webflow-reference.html#whatsnew-swf-220
This link to the official documentation has a sample app integrating Spring WebFlow with faces.
It is possible to configure Spring MVC with Facelets. Check the solution here: https://github.com/acichon89/springmvcfacelets
Yes, You can. Rather very well you can have JSF frontend, Spring framework in the middle and probably Hibernate/webservice/JDBC in the backend.
For actions initiating from the JSF page which you migh expect to call the Spring in the backend, the controller in the JSF should call the Spring POJO and then onwards the it's all Spring to take care, you may have to pass on your bean from JSF to Spring bean.
Sometime back I found this document, hope it helps you.
Is there any reason to use Spring MVC (or other similar frameworks) as a server for GWT RPC? As far as I can tell, 99.9% features of Spring will not be used. Yet, lots of people are looking for best ways to use them together.
Could someone please explain, what are the benefits of using MVC frameworks (on server) with GWT, when all you need on server side is business logic?
I don't see any generally good point in using Spring MVC or another enterprise Java MVC library (like Struts) together with a layer which - as you said - offers only business logic (and therefore can be kept as small and clean as possible).
But Spring itself is way more than just a web (MVC) framework layer and using the dependency injection or AOP features or the ORM API or the Scripting language Groovy (which works fine with Spring) can be a huge benefit for any application.
Spring is much more than just MVC.
Even when you do your UI with GWT, you still need some kind of backend logic.
Things like databases, transactions, security, additional services integrations (emails? SOAP?) and so on.
For this Spring or any other Java server side technology can be a good solution.
As daff said, Spring brings DI + AOP + transactions + many things...
It is useful to have those stuffs managed on your server side with Spring.
Furthermore, the library gwtrpc-spring offers a very convenient way to declare POJOS as rpc services, with the #Service annotation. It avoids declaration of each rpc servlets in the web.xml, as the scan for classes with #Service is automatic.
GWT is just a toolkit, not a framework. If Spring can ease your dev, just use it.
I tend to go for GWT + GIN on the client side and Guice on the server side.
But Spring could just as wel be used for persistance, transactions and organising your business logic on the server side.