in two cases
1. The JS code is in the JSP page, which can directly use EL expressions. For example:
2. JS code is a separate .js file, which is introduced into JSP. At this time, it can be solved by defining JS variables in advance, such as:
Define the JS variable contextPath on the JSP page.
In this way, the contextPath variable can be used in the JS file introduced later.