日期:2014-05-16 浏览次数:20482 次
<%!??
????????int?a?=?1;??
????????private?String?sayHello(){return?"hello";}??
????%>??
????<%??
????????int?a?=?1;??
????%>??
????<h1>Hello?World</h1>???
<jsp:declare>??
int?a?=?1;??
private?String?sayHello(){return?"hello";}??
</jsp:declare>??
<jsp:scriptlet>??
int?a?=?1;??
</jsp:scriptlet>??
<h1>Hello?World</h1>?
public?class?_xxx_test{??
????int?a?=?1;??
????private?String?sayHello(){return?"hello";}??
??
????public?void?_jspService(HttpServletRequest?request,?HttpServletResponse?response)??
????throws?IOException,?ServletException{??
??
????????JspWriter?out?=?xxxx.getWriter();??
????????//?创建其他的隐含对象??
??
????????int?a?=?1;??
????????out.write("<h1>Hello?World</h1>");??
??
????????//?释放资源??
????}??
}??
<%?? ????String?s?=?"test%>"?? %>??
public?class?_xxx_test{??
????public?void?_jspService(HttpServletRequest?request,?HttpServletResponse?response)??
????throws?IOException,?ServletException{??
????????JspWriter?out?=?xxxx.getWriter();??
??
????????//?创建其他的隐含对象??
??
????????String?s?=?"test??
????????out.write("\"\r\n%>");??
??
????????//?释放资源??
????????}??
}??
[java]?view plaincopy <%?? ????int?a?=?1;?? %>??
<jsp:scriptlet>int?a?=?1;</jsp:scriptlet>??
public?class?_xxx_test{??
????public?void?_jspService(HttpServletRequest?request,?HttpServletResponse?response)??
????throws?IOException,?ServletException{??
????????JspWriter?out?=?xxxx.getWriter();??
????????ExprEnv?exprEnv?=?xxx.create();??
??
????????out.write("abc");??
????????org.xxx.xxx.Expr?_expr_xxx?=?xxx.createExpr("${user.name}");??
????????_expr_xxx.write(out,?exprEnv);??
????????out.write("123\r\n");??
????}??
}??