`
danielhjd
  • 浏览: 242792 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

(笔记)JSP中pageContext 与 pageContext.Application_Scope

    博客分类:
  • J2EE
JSP 
阅读更多
(1)Application_1.jsp
<body>
<% String str="hello String";
      pageContext.setAttribute("string_1",str);
      String str1 = (String) pageContext.findAttribute("string_1");
      out.println(str1);%>
</body>

(2)Application_2.jsp
<body>
   <%String strr=(String)pageContext.getAttribute("string_1",pageContext.APPLICATION_SCOPE);
   out.println("get application property:" + strr); %>
  </body>

(3)Application_3.jsp
<body>
  <%String str=(String)pageContext.getAttribute("string_1");
  out.println(str);%>
  </body>


三段代码对比 你会发现区别 哈哈!!!!

(java还是得多打多敲 哎   我不太喜欢 但是一敲了 就想很多   做起来就慢 I am junior, But I want to be Superman...)
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics