Anybody configured Coldfusion 8 with Spring-Hibernate? - spring

I want to run an application[MVC] with models in Spring framework and Data Access layer in Hibernate, View and Controllers in Coldfusion.
Has anybody configured such and application ?

There is Palladium, which allows you to use ColdFusion as the view layer, but everything else is controlled by Spring MVC.
Mike Nimer has a blog post about setting Spring up in ColdFusion.
I wrote a proof of concept with a Spring bean factory wired into FW/1, but it never went beyond the prototyping phase. I.e. it works, but has not been tested as production worthy.

Related

Is Migration from Struts to Spring wholesale change?

I have a Struts 1 application and I am exploring different options for upgrading the system. One option is Spring MVC or Spring Boot. If I were to choose either framework to migrate the application to, can I do so transitionally (piece by piece) or would it be a complete wholesale change or complete rewrite. Don't know if I'm making myself understood.
Spring 3.0, had explicit support for integrating struts 1. This was two major versions of spring and 9 years ago. There is documentation here:
https://docs.spring.io/spring/docs/3.0.5.RELEASE/reference/web-integration.html#struts
Integration consisted in either using the ContextLoaderPlugin to allow spring to manage all your action classes, or to make your action classes aware of the spring context. A fair amount of struts specific code was available to do things like map struts action handlers to action beans in the spring context.
You could probably reproduce a lot of this in spring 5, but you'd have to do a lot of heavy lifting on your own. There are probably very few struts/spring 5 users out there to help you.
You could also go with spring 3.0 to make the integration easier, allowing you to do the migration in steps, but then you are in a different bad place. You have an old version of spring that fewer people use, and none of the goodness that 9 years of releases have wrought.
If you want to migrate your struts 1 app to spring, you are probably going to have to do it all at once. Redo your action classes as springmvc controllers and then rewrite your views (templates). spring mvc is pretty view agnostic and there are many good choices.
Good luck and have fun!

Use Spring to run Flyway migration before starting webapp

We use Spring and are integrating Flyway in a webapp that uses DispatcherServlet and runs a background DB thread.
How do control the execution flow of Spring so the migration happens before it fires up? Delaying DispatcherServlet start and Controller creation should be enough for our purposes.
You can try Spring Boot flyway support http://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html
I havent used it, but I hope it run the flyway scripts before it "starts" the "real" application. (If not it would be quite useless)
What you really want is for Flyway to migrate the database before your persistence layer comes up.
Since your controllers already depend this persistence layer, you now need to make the persistence layer itself depend on Flyway. Using XML configuration, this can be achieved using a depends-on attribute as described in the official docs.
I think afterMigrate method of Flyway Callbacks are what you are looking for.
You could have flyway in a separate factory to your spring MVC stuff. That way you can force the factory with flyway and other business logic etc to be completely created and done before the specifically MVC stuff comes up.
I would recommend you separate these two concerns in to separate factories in any case as it separates the two contexts quite nicely.
One way to achieve this is to start the business logic/flyway factory with a listener that is before the spring MVC stuff...

Spring MVC vs Spring WebFlow

I am doing some research for some social network project which i am going to start. I used Spring before yet i cant make a decision at the moment since there are way too many options to choose.
I would like to use JSF2.0 components on my views , and as far as i figure out webflow is a nice way of doing it yet it is not a must.
What benefits does webflow give over Spring web mvc ? My first impression about WF is it makes things way too complicated.
Thanks in advance
Webflow is about flows in web application.
Think of a Wizzard with several Pages, then Web Flow helps you to connect this Pages (in a flow), and provides a variable scope to connect variable with this flow.
While Spring MVC is "only" about isolated Pages.

Tutorial for using spring beans in jsp pages

(I am not familar with technologies related to HTML delivery, like JSP... But I know basic concepts...)
In my application I use Spring Beans and Spring Security together with Blaze DS to communicate with Flex applications over AMF protocol. Everything works just fine.
Now I have a task to deliver some services via HTTP/HTML eg. it should be some sort of servlets or JSP pages that generates HTML for users. To not reproduce all business and data access logic I want to utilize my existing Spring Beans (I love Spring.). So, basically I want to create HTML view for my Spring Beans.
My question: What would be the best way to do it? Which technologies I should use? What guru-guys will suggest?
The best tip would be a link to small tutorial that will explain how to access Spring Beans for JSP pages. I tried to goole myself but there are too much information and I am a little bit nixed up with different version - so I really have no clue what should I start with...
You should look into Spring MVC. You can find an introduction here.
Also the accepted answer to this question discusses how to do what you want specifically (i.e. access your Spring Beans from JSP pages).

spring mvc vs seam

Spring mvc is a framework that has been long time out there, it is well documented and proven technology. A lot of web sites are using spring.
Seam is a framework based on jsf - rich faces implementation.
It has a lot of ajax based components.
It uses some heavy stuff like EJB, JPA.
All of this is prone to errors and this framework is so slow (at my computer it is almost impossible do develop something because it is really slow, especially redeploying on jboss)
But is is very good for back office applications.
Does someone have a professional experience with this two frameworks?
Can you recommend the better one ?
Why?
Regards
I use both: Spring-MVC (2.5) and Seam
Because Seam uses Java Server Faces Technology (A server-side based Technology), behind the scenes, It is better designed for small and medium applications. (Each JSF view Tree is stored on Session - You can store on client side, but be aware bandwidth issues). But it has some advantages:
Typically web application uses the following path
view >> controller >> service >> domain
With Seam, you can get
view >> service >> domain
Or even (by using mediator pattern provided by Seam Framework)
No controller, No service
view >> domain
Besides that,
JSF 2 supports JSR 303 - Bean Validation
You can use Wicket instead of JSF if you want
Conversation and Business process management support
Use can use Spring DI if you want
Spring-MVC
It has a powerful web-Tier infrastructure
Handler Mapping (It chooses which Controller should handle the request)
View resolver (It chooses which View should render the response)
It can be used for large applications
Powerful data-binding
Spring 3.0 supports Annotation-based Controller (JSR 303 - Bean Validation, coming soon)
But i still not use Spring 3.0 because
By using (and extending when needed) MultiActionController, i can get convention over configuration without no xml settings to define your Controller (You just need to set up your MultiActionController as #Component)
SimpleFormController provides similar behavior found in Spring 3.0 annotation based controller
...
About The learning path, i think both are similar.
I have worked professionally with Seam and it is a killer framework. It really boosts up your productivity. You can use POJOs instead of EJBs, if you think EJBs are slowing you down. About the deployment, just consider deploying to Tomcat instead of JBoss. On my machine redeployment in Tomcat is done in a couple of seconds. But I still haven't used Spring MVC to compare them.
We have been using Seam for a very large site using POJOS and communicated with web services or Hibernate deployed on Tomcat. We have found that the back button support does not work well or is prone to being specific to implementation patterns. Additionally, there is a tendency for sessions to grow very large if using server side state. Attempts to reduce the session size impact back button support or iframe usage due to reduce number of view states stored in session. More or less, our issue have all been performance related. The tomcat requires more memory and supports less users when compared to a struts 1.2 or spring mvc. We are using around 50 tomcats to support our userbase.
I have used both SEAM and Spring MVC for a few months.
I prefer Spring MVC to SEAM. BTW I noticed JBoss halted the SEAM3 development.
I found a interesting article about comparison of SEAM and Spring MVC.
The link is
http://java.dzone.com/articles/why-java-ee-lost-and-spring?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobby+%2F+Java+Zone%29&utm_content=Google+Reader
Thanks
I have used both Seam 3 and Spring 3 frameworks.While Seam 3 is easier to code and has a lot of features supporting session management and transaction management ,the performance is slow.Spring is much faster.

Resources