JSP - “<%...%>”VS“<%= ...%>”之间的区别是什么 [英] JSP - what's the difference between “<% … %>” VS “<%= … %>”

查看:210
本文介绍了JSP - “<%...%>”VS“<%= ...%>”之间的区别是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 JSP 文件和servlet时,我遇到了<%...%> <%= ...%>

While working with JSP files and servlets , I came across <% … %> and <%= … %> .

两种情况有什么区别?

What's the difference between both cases ?

谢谢

推荐答案

<% = ...%> 将回显变量,其中<%...%> 表示脚本或某些已执行的代码。

<%= … %> will echo out a variable, where as <% … %> denotes a script or some code that is executed.

以下是jsp文档的链接:

Here are the links to the jsp documentation:

  • Expression (<%= … %>) : http://java.sun.com/products/jsp/tags/11/syntaxref11.fm4.html
  • Scriptlet (<% … %>) : http://java.sun.com/products/jsp/tags/11/syntaxref11.fm5.html

这篇关于JSP - “&lt;%...%&gt;”VS“&lt;%= ...%&gt;”之间的区别是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆