ctx is a variable, and ${} includes it to get its value. For example, there is a map. Its structure is key, value. map.put("ctx",www.baidu.com); Then what ${ctx} gets is www.baidu.com
Get the value in the field in jsp, 1 page current page, get it by setting the value on the current page, <c:set var="ctx" value="http:// localhost:8080/"> ;,${pageScope.ctx} value is "http://localhost:8080/"; <c:set var="ctx" value="http:// localhost:8080/">,${pageScope.ctx}值为"http://localhost:8080/"; 2 request.setAttribute("ctx", "http://localhost:8080/"), ${requestScope.ctx}值为"http://localhost:8080/"; 3 request.getSession().setAttribute("ctx", "http://localhost:8080/"), ${sessionScope.ctx}值为"http://localhost:8080/"; 4 request.getSession().getServeltContext().setAttribute("ctx", "http://localhost:8080/")2 request.setAttribute("ctx", "http://localhost:8080/"), ${requestScope.ctx} value is "http://localhost:8080/";
3 request.getSession().setAttribute("ctx", "http://localhost:8080/" ), ${sessionScope.ctx} value is "http://localhost:8080/";
4 request.getSession().getServeltContext().setAttribute("ctx", "http:/ /localhost:8080/"), the value of ${applicationScope.ctx} is "http://localhost:8080/";
🎜This is the 4 fields page, request, session, application. If you only use ${ctx}, then the object will be found from these four fields. If not found, then a null value will be returned, not null; except The first one is outside the setting of this page. The others are set in the first few requests. If you are interested, you can go to Baidu to see what the scope of these domains is. 🎜
${} This way of writing is called el expression. In jsp, it is used to search for the value of the key-value pair in page, request, session, and application until it is found. Normally there is one in your jsp page ctx setting, the code generated by the normal IDE using the JSP template will also automatically generate the code for this setting. It is the data from the global context - the domain name address requested by the project
ctx is a variable, and ${} includes it to get its value. For example, there is a map.
Its structure is key, value. map.put("ctx",www.baidu.com);
Then what ${ctx} gets is www.baidu.com
Get the value of the specified name in the domain
Simply put, it’s the “?” to be retrieved
Get the value of variable ctx
Get the value in the field in jsp,
31 page current page, get it by setting the value on the current page,
<c:set var="ctx" value="http:// localhost:8080/"> ;
,${pageScope.ctx} value is "http://localhost:8080/";<c:set var="ctx" value="http:// localhost:8080/">
,${pageScope.ctx}值为"http://localhost:8080/";2
request.setAttribute("ctx", "http://localhost:8080/")
, ${requestScope.ctx}值为"http://localhost:8080/";3
request.getSession().setAttribute("ctx", "http://localhost:8080/")
, ${sessionScope.ctx}值为"http://localhost:8080/";4
request.getSession().getServeltContext().setAttribute("ctx", "http://localhost:8080/")
2request.setAttribute("ctx", "http://localhost:8080/"), ${requestScope.ctx} value is "http://localhost:8080/";
request.getSession().setAttribute("ctx", "http://localhost:8080/" )
, ${sessionScope.ctx} value is "http://localhost:8080/";4
🎜This is the 4 fields page, request, session, application. If you only use ${ctx}, then the object will be found from these four fields. If not found, then a null value will be returned, not null; except The first one is outside the setting of this page. The others are set in the first few requests. If you are interested, you can go to Baidu to see what the scope of these domains is. 🎜request.getSession().getServeltContext().setAttribute("ctx", "http:/ /localhost:8080/")
, the value of ${applicationScope.ctx} is "http://localhost:8080/";${} This way of writing is called el expression. In jsp, it is used to search for the value of the key-value pair in page, request, session, and application until it is found.
Normally there is one in your jsp page ctx setting, the code generated by the normal IDE using the JSP template will also automatically generate the code for this setting. It is the data from the global context - the domain name address requested by the project
Get the value in the model,
ctx
can be regarded as the key of a map.