Can jsp rendered pages be embedded in react development widgets?

the Wap page rendered by jsp needs to be replaced with a new navigation. Can this navigation (including login / logout functions) be written in react and put into jsp? How to use it?


first of all, it is not possible to reference react components directly in jsp, because react code needs to be packaged and compiled into native js code

you can create a new jsp: such as nav.jsp, then write react code normally and package it into nav.js, introduced in nav.jsp (including login function), and then add this nav.jsp include to the existing jsp

if it's too troublesome or just wants to write js code directly in jsp, you should write native js code or use some auxiliary library files such as JQ

Menu