时间: 2021-07-31 作者:daque
上头提到的,即使只是是scriptlet是不会爆发html的。即使scriptlet想爆发html,它不妨运用一个称为“out”的变量。这个变量不须要设置。本质上,它仍旧为scriptlet被预订义了,一道被设置的再有其它变量,那些变量在后续的教程中会细说。底下的例子向咱们展现了scriptlet是还好吗爆发html输入的:<html><body><%// this scriptlet declares and initializes "date"system.out.println( "evaluating date now" );java.util.date date = new java.util.date();%>hello! the time is now<%// this scriptlet generates html outputout.println( string.valueof( date ));%></body></html>在本例子中,咱们没有运用表白式,而是将爆发的html径直打字与印刷到“out”变量中去。这个“out”变量是一种javax.servlet.jsp.jspwriter。