程序过多的出现<%=%>会导致代码混乱,而jsp提供一种scriptlet标签,可以与<%=%>具有同样的功能
例如:scriptlet_tag.jsp
<html>
<head>
<title>测试</title>
</head>
<body>
<jsp:scriptlet>
String name="xiaoming";
</jsp:scriptlet>
<h1><%=name%></h1>
</body>
</html>
显示:xiaoming
在开发中没有严格的规定,唯一的好处就是美观一点!