This week's giveaway is in the Cloud/Virtualization forum. We're giving away four copies of Production-Ready Serverless (Operational Best Practices) and have Yan Cui on-line! See this thread for details.
I took a tutorial in React. It seems it runs in it's only little world outside of an application server and the only way it can get data is with AJAX-REST calls. I am looking to re skin and application with a new front end, but keep the JEE backend intact. Management in my company is pushing React, so how can I make this work? When a user logs in, there is a lot of data structures loaded into the session and it would be impractical to load all of that in a browser.
1) Create one or more REST calls to retrieve that information. You don't need to use something like JAX-RS or Spring MVC, you can also create the calls with servlets (although it may be a bit more work).
2) Have your JSPs (or servlets, but JSPs should preferably be used for the rendering) output a script block with the necessary content.
Yes, I see online that React and Java don't play well together. Some people are trying to use Spring boot but it's painful. I find React frustrating, it's so different from anything else I have experience with. The learning curve is huge.
I'm guessing here, but but perhaps part of the problem is learning ES6+ in addition to React? React itself can be pretty simple to get started with; but learning its toolchain (Babel and Webpack et al) is a huge hurdle, and learning all the new notation in ES6+ can make it grueling.
Also, once you throw Redux into the picture, well, now it's getting complicated...