Spring framework replacement for FlowAction - spring

I recently inherited a very old code base (written in 2006) that uses the spring framework. Right now, the goal is to get it semi-functional, which I've almost done. However, there is some code I can't seem to fix that uses the class "FlowAction" from 'org.springframework.webflow.executor.struts.FlowAction'. This used to exist in the spring-webflow-1.0.6.jar, but no longer exists in 2.4.2.
Can anyone give me any hints for how to fix the following code using more recent spring framework code?
<action path="/secure/FRONT/enrollAction"
name="webflowActionForm" scope="request"
type="org.springframework.webflow.executor.struts.FlowAction" />
Please keep in mind that this is an attempt to get this very old code working so telling me it's impossible is fine, but please provide a good reason why (I'm no spring expert). I've googled and searched the spring code to no avail, but I'm hoping it's as simple as using a different library. Thanks for any input!
EDIT
Based on the first comment below, struts is no longer supported. I am offering a bounty for someone who knows how to update this code. I assume an alternative exists, or was offered by the spring framework, for code that was using the old libraries. If anyone knows what that is, I would greatly appreciate it. I just need help on how I would update the specific block of code above and am happy to provide any further information needed.

FlowHandlerMapping
FlowHandler
FlowHandlerAdapter
FlowExecutor
FlowDefinition
FlowRegistry
we can use the following classes for getting struts functionality to your code

Related

Why Spring's ReflectionUtils marked as "Only intended for internal use"?

Can I use this library? Or is it not desirable? And why?
I was trying to find answer, but have found nothing about this warning.
If usage of this library is not good idea, may be you will able to advise me another library.
Thanks for advance!
You can use it and I think the chances of Spring changing it are quite small, but there's no concrete intention from the Spring development team to keep that class as it's, as opposed to what they do with their public/non-internal APIs.
So if it changes in the future, the spring guys won't be accepting any complains of the type 'but my code depends on that class and you change it!.

Example for CDI-SessionScoped LogIn with TomEE

i'm currently fighting with TomEE, JSF and CDI (i think).
Is there any example out there which has "#javax.enterprise.context.SessionScoped" annotation using TomEE 1.5.1 (or current snapshot)?
I DONT want to use #ManagedBean or something else from javax.faces, just plain CDI.
My problem is: when i change some #SessionScoped user session instance i end up in having a new sessionID (session fixation problem?!?).
My Use-Case:
I want to have a login on one page and have the possability to login from anywhere, the user comes from a JPA-layer which scope i don't know exactly if have to choose.
Is there another way to archieve this?!
I already got this pages, but didn't helped me out:
http://openejb.979440.n4.nabble.com/Guest-user-td4655258i20.html
https://issues.apache.org/jira/browse/TOMEE-734
https://issues.apache.org/jira/browse/TOMEE-745
Thanks for any help!
After a lot of time i created my own "proof-of-concept"-example working with cdi-beans:
https://github.com/FibreFoX/cdi-sessionscoped-login
I hope it will help others, like it helped me while developing that piece of awesome :)
I Use TomEE but I don't understand your problem. Do you use the web-profile?
Did you setup beans.xml correctly?
The bugs you linked are unrelated probably your setup. Impossible to say since I don't have anything to go on. Link a sample project I can try or at least paste your bean and tell were you put beans.xml

Spring framework self-training

I'd like to learn Spring MVC framework basis.
My personal experience tells clearly that more than reading manuals, docs, howtos only is only one important part of self-training, but to capitalize real experience you need to solve real problems.
May someone suggest a fake-project that I can implement in my free-time, avoiding only-theoretical approaches and at the same time watch at the main issues of Spring programming?
Does a NerdDinner.com-like free-chapter somewhere exists for Spring?
You could go through each of the Spring samples, and attempt to recreate them on your own.
I have found that a very effective method for learning Spring is to go on the Spring JIRA and solve a bug. It forces you to get down and dirty in the code, and you get to see what's really going on behind the scenes.

Should i use the latest version of Spring

I am just starting to learn about spring and was looking at the difference between Spring 3.0 and Spring 2.5.
Initially i was following this tutorial http://static.springsource.org/docs/Spring-MVC-step-by-step/index.html which is a step by step guide to developing a Spring MVC application. It is based on Spring 2.5 and i notice there are quite a few differences with Spring 3.0. I tried to find the equivalent tutorial that is based on 3.0 but couldnt find it.
The difference i notice with 3.0 is that there is a lot of use of annotations and a lot of things is done for you in the background. I am sure this is a good thing but i am wondering for the purpose of learning the framework should i continue with 2.5 so that i can understand what goes on behind the scenes before i use spring 3.0?
Please also if you can recommend a spring book that is suitable for a beginner i would appreciate it.
Thanks
I'd recommend to always use the latest version of a framework. Especially if you're starting on a new project. There are always (well usually) tons of improvements, and simplifications, and migrating to the latest version later may be a pain.
Spring has a great user manual (see http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/), and IMHO a book doesn't have an added value in this case. I found the Spring user manual always easy to read and understand, so don't get intimidated. I think this is definitely the best starting for beginners as well. You don't have to read it all. Only the sections of interest!
Note that Spring 3.x contains many other improvements such as SpEL (Spring Expression Language), improved web support (you already saw that), REST support, and more.
... should i continue with 2.5 so that i can understand what goes on behind the scenes before i use spring 3.0?
That's really up to you to decide, but if you are going down the Spring 3.x annotation-based route, it is not clear that you >>need<< to understand what is happening behind the scenes. Especially for run-of-the-mill applications.
I was not aware of the purchase of Spring by VMware. Do you think this might affect the open source aspect of Spring in that it might not be open source anymore?
First, the SpringFramework guys are thoroughly committed to open source (from what I can see). So a change would probably entail lots of developers leaving.
Second, most of the people who use Spring do so because it is open source, so a change would risk a major migration of (paying) customers away.
Third, turning Spring into a closed source product would be a politically awful move for VMware, and would likely have fallout for other VMware product lines.
Finally, and most importantly for people committed to using Spring: there is no way that the VMware could legally "undo" the open sourcing of current Spring releases. The best they could do would be say that Spring 4.0 etc was closed source. Anyone who wanted to would be free to continue distributing and using SpringFramework 1.0.x, 2.0.x, 2.5.x, 3.0.x and all associated open sourced technologies. And anyone would be free to create a "fork" of any of them to continue Spring open source development. The only possible issue would be the use of trademarks, and that is easily worked around.
Add that all up, and (IMO) there is nothing to worry about.
"Spring in Action", "Pro Spring", and "Spring Recipes" are the three that I'd recommend to anyone.
If you've never used Spring, I'd say that learning either one will suit your purposes. The majority of Spring 2.5 carries over to 3.0, so it's not wasted.
The books and tutorials haven't kept up with Spring 3.0. Another change between versions was the purchase of Spring by VMWare. They've separated paid support from open source, so it's hard to tell what the future will be for non-paying customers.

Learning Spring MVC For web-projects

I have looked at Spring MVC a few times briefly, and got the basic ideas. However whenever I look closely it seems to require you already know a whole load of 'core Spring'. The book I have for instance has a few hundred pages before it gets onto Spring MVC... which seems a lot to wade through. I'm used to being able to jump in, but there's so much bean-related stuff and XML, it just looks like a mass of data to consume.
Does it simplify if you put the time in, or is Spring just a much bigger framework than I thought? is it possible to learn this side of it in isolation?
#John Spring just a much bigger framework than I thought? - probably so, at least I thought so.
is it possible to learn this side of it in isolation? - Yes , here is a good way to learn your way http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/spring-web.html
And also I'd recommend you read a book manning spring in action 2nd edition, I also was learning spring from zero, and now I'm comfortable with it after reading this book, of course you have to refer to reference every now and then.
Here is where you can get basic info about MVC concept if you are not already familiar with(its in php, but important thing is point not syntax)
http://net.tutsplus.com/tutorials/other/mvc-for-noobs/
EDIT
If you want to see MVC in action, with examples or other spring uses use this repository https://src.springframework.org/svn/spring-samples to checkout some projects , you'll see mvc-basic, mvc-ajax ..etc this is really good resource , you can checkout projects with Tortoise SVN on windows or subeclipse from eclipse
At least you need to understand the core Spring - dependency injection, application context configuration and so on. It's actually not too complex, just a bit hard to start. For an experienced developer it might make sense to take a look at some sample app for the basic setup.
ps. I've got this sample project for JSF/Spring/JPA/Hibernate combination. Not Spring-MVC, but may be still helpful.
I myself am trying to learn Spring MVC from NetBeans official documentation from here:
http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
Coming from ASP.Net/C#, it feels like there are so many steps to do in that simple example.
The great thing about Spring is that you can pick and choose what you use. If you want to use Spring, you don't have to jump in head first, you can just try it out by, say, using the Dependency Injection features, or by using the JDBC Template stuff. My recommendation would be to start small, and see how you like it.
To use the Web MVC stuff, you will need to understand Dependency Injection for configuring your controllers. You can choose to use the older more flexible XML-style configuration, or you can use the newer Annotations. Or you can mix and match. Starting with XML would probably be best as it will help you understand how stuff is working (it'd be like learning C and C++ before Java). Then you can move to using Annotations. Personally, I use XML to instantiate all my beans. I use the #Autowire annotation to inject dependencies. This seems to be the sweet spot for most flexibility and ease of use.

Resources