简体   繁体   中英

compatibility between React.JS and java

I have a question that tapped me. can someone help? Here is my question: can react front end be used with java ? If yes How is it possible? Thank you in advance

Yes of course, in fact java and react or any other front-end technologies should not have a problem communicating to each other. You may want to do some readings on Representational state transfer (REST).

Yes it is possible to use react front end and java as back end.
Let us assume you want to build simple school management application with following feature.
In home page we want to show simple three tab student teacher and admin .By clicking over each tab it should show a page containg that partucular user realted data(userName, picture, address).

We will be having simple Mysql database to store user information.

Use React:
To build this I will use express as framework to use React.In React I will be having component HomePage and UserInfo . When we click any tab on home page we need to fetch data from database. To call an external api I will use redux and save data in redux store.
Your frontend will be running on express(assume on localhost:3000)

Use Java:
As backend Let us assume we want some manipulation of data so we will use java(use jersey to make rest apis).In java we can make connection to database and fetch data.Using java we will make a post api taking user type which return user data in json format.This json will be stored in redux store.So in new page after clicking I will iterarte through this data and show in page.
Your backend in java will be running on tomcat(assume on localhost:8000)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM