Stuck on Configuring Spring Webflow on Netbeans 7.0 - spring

am very new to java ee and am trying to develop an app with JSF. I tried to define my own flow definition "language" 'chuckles' when i realised there had to be an enterprise class plugin out there for the purpose. With the help of google, i then stumbled upon Spring Web Flow and the specs are exactly what i need. I am using NetBeans 7.0 and Glassfish 3.1. Now problem is i have spent two full days trying to figure out how configure the vrious components to work together. I downloaded spring-webflow-2.3.0.RELEASE. I am stuck on the next step. The netbeans 7 i have comes bundled with Spring Framework 3.0.2.RELEASE and Spring Web MVC 3.0.2.RELEASE.
If anyone knows of a good basic guideline on how to configure spring webflow to work with JSF in netbeans, please help me out. Hope i did not sound too stupid.
regards,

Related

Payara 5/6 and SpringFramework

I've come to the conclusion that the Spring Web MVC is not compatible with Payara 5 and 6. I have an application that uses Glassfish 3, Spring Web MVC, and EclipseLink JPA. I intend to upgrade the code to Java 17 and Jakarta EE. In the sake of kindness, it hasn't gone well. In all my efforts, it's been Spring's Web MVC that is causing the problems. Spring charges for support and that's not a viable option for me. Before I scrap it's use, let's pick your brain.
If anyone has implemented Spring Web MVC successfully with Payara 5 and/or 6, please share how you made it work.
My first step was to try Payara 6 for Jakarta EE. After creating a VERY small Hello World web app, I included Spring Web MVC jar and did the minimum to activate it's Dispatcher Servlet. I was never able to overcome the error CDI is not available.
Secondly, I backed off to Payara 5. In that attempt, it tries to instantiate a JPA EAO Bean that the app will use in all it's controllers to access the app's DB. The error here appears to be when it attempts to use FasterXML to read the persistence.xml file. That part of the app works fine when I create the EAO object with JUnit.
Rather than providing all the gory details, reviewing the artifacts from a successfully implemented app with help me tremendously.
Thank you for your help!
So after weeks of beating my head against a wall trying all kinds of things to get it working, I wrote to one of the SpringFramework developers, Juergen Hoeller. Here's his response....
Sorry to hear that there is so much trouble on Payara still. We also
have corresponding reports on GitHub:
https://github.com/spring-projects/spring-framework/issues/29718
https://github.com/spring-projects/spring-framework/issues/29743
Unfortunately neither of the two is an actual problem to be solved on
Spring's own side, as far as I can see.
With the CDI issue, it's Payara's CDI implementation not being able to
parse Java 17's new record types. Also, I wonder why Payara needs to
parse every single deployed class file if you are not actually using
CDI. It might be possible to turn that off, but at the very least,
Payara should defensively handle "unknown" types.
With the Hibernate issue, it's a problem with Hibernate 6 initializing
its Jackson configuration on Payara. There does not seem to be a StAX
provider available, and Hibernate insists on one being present for
Jackson.
Overall, this needs to be taken to Payara and Hibernate, we are not
aware of anything Spring can do better. Feel free to add further
comments to the GitHub issues in case there is anything we can do from
our side! Even if our focus is on Tomcat/Jetty these days, we of
course want Spring 6 to work fine on Payara as well.
Thanks for your efforts to try to make this work,
Juergen
So now, how do we get the attention of Oracle's Glassfish developers and Payara's developers to get this resolved???? In the meantime, I think I'll have to install Tomcat or some other free webserver. Thanks, Oracle.
This was reported against Hibernate before, but Glassfish/Payara simply have a broken classpath config. Also see https://hibernate.atlassian.net/browse/HHH-15556
Maybe try using Wildfly, which is also free ;)

How to apply the Strangler Pattern with old Struts 1 application into Spring app

We currently have an old web application that's been developped under Struts 1.4.3 Framework. This application works fine on a production environment,
but now we need to upgrade it to Spring. Instead of starting a new app as a greenfield project, we figured out that it could be a better idea for our client if we'd apply some transition techniques, such as the Strangler pattern. Then, we could bring some business value quickly to the client during the development process.
So here is our plan:
We will develop new screens one by one (Spring boot web app), and release those screens in production environment once they're ready.
I would like my main entry point to be into our new Spring boot application.
Then, I'd like to commute the requests of the client to whether new developed screen under spring boot controllers, or to old existing Struts 1 actions.
So for the user, the transition from a old to a new application would be 100% transparent
I found some solutions on Internet but none of them seems to give a clear way to proceed.
This article seems really appropriate to my need: https://www.ibm.com/developerworks/library/j-sr2/index.html
But I'm having questions that the article does not answer.
Do Struts and Spring code base have to be within the same Java project in order to use the article's recipes?
The article stated above is 14 years old, so Spring libraries handling the integration of Struts appear to be deprecated. I can't find "org.springframework.web.struts" anymore in Spring framework 4.3.20. How to apply it now?
Thanks guys for your help.

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

Setting up Intellij with Spring MVC framework

I've been Googling and reading a lot but I simply cannot add spring framework to my application.
On the IntelliJ website it says simply click 'Add module' and then under technologies select Spring. The only technology I have available is Groovy?!
Can anyone please help me with this?
The Community Edition of IntelliJ doesn't have the same out-of-the-box support for Spring (and EE development in general) the Ultimate Edition does.
Features and edition comparison
You may still use Spring, but you won't get the same IDE integration.
I would suggest trying the offical spring website tutorial with one of these two Youtube videos:
Official Spring website about Intellij:
Serving Web Content with Spring MVC, Build with your IDE
Youtube video tutorials on setting up spring with Intellij:
Spring MVC with Intellij Full Java Config. No web.xml or Servlet.xml
or
Spring MVC application with Intellij Idea (with xml config)

SpringSource Tool Suite and GWT without using ROO?

I would like to know if anyone has any experience in using STS to create a Spring-enabled GWT web application without using Spring ROO.
There are 2 scenarios that I have.
I have an existing GWT application (not Spring-enabled, built in Eclipse 3.7) that I want to convert to a Spring-enabled GWT application in STS. I want STS to pick up that this is now Spring-enabled so that I can use the built-in features of STS for Spring.
Create a new GWT web application that is Spring-enabled in STS, but without using Spring ROO.
I have as of yet found no tutorials on how to do either. All the examples that point to creating a Spring-enabled GWT web application in STS use ROO to scaffold it for them.
Sorry if it is a bit unclear what I mean. Feel free to comment and I will try to explain more.
Thanks!
One possibility is to start with a Roo project, enable GWT, and then perform a push-in refactoring. This will remove the Roo dependencies and what remains is a pure spring project that uses GWT.
gwt-spring-starter-app will help you create a maven project with spring & gwt integrated. You can then import it as a maven project into STS. That should get everything correctly setup.

Resources