jsp/JSTL/javascript 变量访问

1. Javascript访问JSP变量

<% String some_jsp_var = "This is a java variable in a JSP."; %>



2. jsp 访问JSTL变量

能访问吗?


3. JSTL 访问JSP变量

<%@ taglib prefix= "c" uri= "http://java.sun.com/jstl/core" %>
<%
   String[] names= { "Tom" , "Dick" , "Harry" , "Matthew" , "Mark" , "Luke" , "John" };
   pageContext.setAttribute( "names" , names);
%>
  
"msg" value= "The names are:" />
"name" items= "${names}" varStatus= "status" >
   "msg" >
     "${msg} ${name}" /> if test= "${not status.last}" >, if >
  
"${msg}" />

你可能感兴趣的:(Java,JSP,JS,javascript,jsp)