search

Home  >  Q&A  >  body text

java - 、这句jsp是什么意思?

href="${ctx}/goPageCenter?code=promos">优惠活动</a>
${ctx}这个啥意思,$符号啥意思?
大家讲道理大家讲道理2897 days ago374

reply all(7)I'll reply

  • 黄舟

    黄舟2017-04-18 09:48:47

    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

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 09:48:47

    Get the value of the specified name in the domain

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:48:47

    Simply put, it’s the “?” to be retrieved

    reply
    0
  • 怪我咯

    怪我咯2017-04-18 09:48:47

    Get the value of variable ctx

    reply
    0
  • 高洛峰

    高洛峰2017-04-18 09:48:47

    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/")< /code>, ${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. 🎜

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 09:48:47

    ${} 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

    reply
    0
  • 阿神

    阿神2017-04-18 09:48:47

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

    reply
    0
  • Cancelreply