java - 、这句jsp是什么意思?
大家讲道理
大家讲道理 2017-04-18 09:46:47
0
7
368
href="${ctx}/goPageCenter?code=promos">优惠活动</a>
${ctx}这个啥意思,$符号啥意思?
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(7)
黄舟

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,
1 page current page, get it by setting the value on the current page, <c:set var="ctx" value="http:// localhost:8080/"&gt ;,${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

阿神

Get the value in the model, ctxcan be regarded as the key of a map.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template